specweave 0.29.0 → 0.29.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.
- package/package.json +3 -1
- package/plugins/specweave-github/hooks/.specweave/logs/hooks-debug.log +12 -0
- package/plugins/specweave-release/hooks/.specweave/logs/dora-tracking.log +18 -0
- package/dist/plugins/specweave-github/lib/enhanced-github-sync.d.ts +0 -26
- package/dist/plugins/specweave-github/lib/enhanced-github-sync.d.ts.map +0 -1
- package/dist/plugins/specweave-github/lib/enhanced-github-sync.js +0 -249
- package/dist/plugins/specweave-github/lib/enhanced-github-sync.js.map +0 -1
- package/dist/plugins/specweave-jira/lib/enhanced-jira-sync.d.ts +0 -28
- package/dist/plugins/specweave-jira/lib/enhanced-jira-sync.d.ts.map +0 -1
- package/dist/plugins/specweave-jira/lib/enhanced-jira-sync.js +0 -156
- package/dist/plugins/specweave-jira/lib/enhanced-jira-sync.js.map +0 -1
- package/dist/src/core/sync/bidirectional-engine.d.ts +0 -119
- package/dist/src/core/sync/bidirectional-engine.d.ts.map +0 -1
- package/dist/src/core/sync/bidirectional-engine.js +0 -359
- package/dist/src/core/sync/bidirectional-engine.js.map +0 -1
- package/dist/src/core/sync/conflict-resolver.d.ts +0 -66
- package/dist/src/core/sync/conflict-resolver.d.ts.map +0 -1
- package/dist/src/core/sync/conflict-resolver.js +0 -108
- package/dist/src/core/sync/conflict-resolver.js.map +0 -1
- package/dist/src/core/sync/enhanced-content-builder.d.ts +0 -55
- package/dist/src/core/sync/enhanced-content-builder.d.ts.map +0 -1
- package/dist/src/core/sync/enhanced-content-builder.js +0 -203
- package/dist/src/core/sync/enhanced-content-builder.js.map +0 -1
- package/dist/src/core/sync/folder-mapper.d.ts +0 -71
- package/dist/src/core/sync/folder-mapper.d.ts.map +0 -1
- package/dist/src/core/sync/folder-mapper.js +0 -203
- package/dist/src/core/sync/folder-mapper.js.map +0 -1
- package/dist/src/core/sync/label-detector.d.ts +0 -66
- package/dist/src/core/sync/label-detector.d.ts.map +0 -1
- package/dist/src/core/sync/label-detector.js +0 -224
- package/dist/src/core/sync/label-detector.js.map +0 -1
- package/dist/src/core/sync/performance-optimizer.d.ts +0 -153
- package/dist/src/core/sync/performance-optimizer.d.ts.map +0 -1
- package/dist/src/core/sync/performance-optimizer.js +0 -220
- package/dist/src/core/sync/performance-optimizer.js.map +0 -1
- package/dist/src/core/sync/profile-selector.d.ts +0 -52
- package/dist/src/core/sync/profile-selector.d.ts.map +0 -1
- package/dist/src/core/sync/profile-selector.js +0 -179
- package/dist/src/core/sync/profile-selector.js.map +0 -1
- package/dist/src/core/sync/profile-validator.d.ts +0 -52
- package/dist/src/core/sync/profile-validator.d.ts.map +0 -1
- package/dist/src/core/sync/profile-validator.js +0 -170
- package/dist/src/core/sync/profile-validator.js.map +0 -1
- package/dist/src/core/sync/rate-limiter.d.ts +0 -116
- package/dist/src/core/sync/rate-limiter.d.ts.map +0 -1
- package/dist/src/core/sync/rate-limiter.js +0 -308
- package/dist/src/core/sync/rate-limiter.js.map +0 -1
- package/dist/src/core/sync/retry-handler.d.ts +0 -98
- package/dist/src/core/sync/retry-handler.d.ts.map +0 -1
- package/dist/src/core/sync/retry-handler.js +0 -196
- package/dist/src/core/sync/retry-handler.js.map +0 -1
- package/dist/src/core/sync/retry-logic.d.ts +0 -64
- package/dist/src/core/sync/retry-logic.d.ts.map +0 -1
- package/dist/src/core/sync/retry-logic.js +0 -165
- package/dist/src/core/sync/retry-logic.js.map +0 -1
- package/dist/src/core/sync/status-cache.d.ts +0 -91
- package/dist/src/core/sync/status-cache.d.ts.map +0 -1
- package/dist/src/core/sync/status-cache.js +0 -140
- package/dist/src/core/sync/status-cache.js.map +0 -1
- package/dist/src/core/sync/status-mapper.d.ts +0 -69
- package/dist/src/core/sync/status-mapper.d.ts.map +0 -1
- package/dist/src/core/sync/status-mapper.js +0 -90
- package/dist/src/core/sync/status-mapper.js.map +0 -1
- package/dist/src/core/sync/status-sync-engine.d.ts +0 -162
- package/dist/src/core/sync/status-sync-engine.d.ts.map +0 -1
- package/dist/src/core/sync/status-sync-engine.js +0 -347
- package/dist/src/core/sync/status-sync-engine.js.map +0 -1
- package/dist/src/core/sync/sync-event-logger.d.ts +0 -113
- package/dist/src/core/sync/sync-event-logger.d.ts.map +0 -1
- package/dist/src/core/sync/sync-event-logger.js +0 -141
- package/dist/src/core/sync/sync-event-logger.js.map +0 -1
- package/dist/src/core/sync/time-range-selector.d.ts +0 -48
- package/dist/src/core/sync/time-range-selector.d.ts.map +0 -1
- package/dist/src/core/sync/time-range-selector.js +0 -224
- package/dist/src/core/sync/time-range-selector.js.map +0 -1
- package/dist/src/core/sync/types.d.ts +0 -52
- package/dist/src/core/sync/types.d.ts.map +0 -1
- package/dist/src/core/sync/types.js +0 -5
- package/dist/src/core/sync/types.js.map +0 -1
- package/dist/src/core/sync/workflow-detector.d.ts +0 -95
- package/dist/src/core/sync/workflow-detector.d.ts.map +0 -1
- package/dist/src/core/sync/workflow-detector.js +0 -175
- package/dist/src/core/sync/workflow-detector.js.map +0 -1
- package/plugins/specweave-github/lib/enhanced-github-sync.js +0 -220
- package/plugins/specweave-github/lib/enhanced-github-sync.ts +0 -322
- package/plugins/specweave-jira/lib/enhanced-jira-sync.js +0 -134
- package/plugins/specweave-jira/lib/enhanced-jira-sync.ts +0 -196
|
@@ -1,196 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Enhanced JIRA Spec Content Sync
|
|
3
|
-
*
|
|
4
|
-
* Uses EnhancedContentBuilder and SpecIncrementMapper for rich epic descriptions.
|
|
5
|
-
*
|
|
6
|
-
* NOTE: This version focuses on enhanced content building.
|
|
7
|
-
* Actual JIRA API integration requires jira-spec-sync.ts
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import { EnhancedContentBuilder, EnhancedSpecContent } from '../../../src/core/sync/enhanced-content-builder.js';
|
|
11
|
-
import { SpecIncrementMapper, TaskInfo } from '../../../src/core/sync/spec-increment-mapper.js';
|
|
12
|
-
import { parseSpecContent } from '../../../src/core/spec-content-sync.js';
|
|
13
|
-
import * as path from 'path';
|
|
14
|
-
import * as fs from 'fs/promises';
|
|
15
|
-
|
|
16
|
-
export interface EnhancedJiraSyncOptions {
|
|
17
|
-
specPath: string;
|
|
18
|
-
domain?: string;
|
|
19
|
-
project?: string;
|
|
20
|
-
dryRun?: boolean;
|
|
21
|
-
verbose?: boolean;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export interface EnhancedJiraSyncResult {
|
|
25
|
-
success: boolean;
|
|
26
|
-
action: 'created' | 'updated' | 'no-change' | 'error';
|
|
27
|
-
epicKey?: string;
|
|
28
|
-
epicUrl?: string;
|
|
29
|
-
error?: string;
|
|
30
|
-
tasksLinked?: number;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Enhanced sync with rich content including task mappings
|
|
35
|
-
*/
|
|
36
|
-
export async function syncSpecToJiraWithEnhancedContent(
|
|
37
|
-
options: EnhancedJiraSyncOptions
|
|
38
|
-
): Promise<EnhancedJiraSyncResult> {
|
|
39
|
-
const { specPath, domain, project, dryRun = false, verbose = false } = options;
|
|
40
|
-
|
|
41
|
-
try {
|
|
42
|
-
// 1. Parse spec content
|
|
43
|
-
const baseSpec = await parseSpecContent(specPath);
|
|
44
|
-
if (!baseSpec) {
|
|
45
|
-
return {
|
|
46
|
-
success: false,
|
|
47
|
-
action: 'error',
|
|
48
|
-
error: 'Failed to parse spec content',
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
if (verbose) {
|
|
53
|
-
console.log(`📄 Parsed spec: ${baseSpec.identifier.compact}`);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
// 2. Build enhanced spec with task mappings
|
|
57
|
-
const specId = baseSpec.identifier.full || baseSpec.identifier.compact;
|
|
58
|
-
const rootDir = await findSpecWeaveRoot(specPath);
|
|
59
|
-
const mapper = new SpecIncrementMapper(rootDir);
|
|
60
|
-
const mapping = await mapper.mapSpecToIncrements(specId);
|
|
61
|
-
|
|
62
|
-
if (verbose) {
|
|
63
|
-
console.log(`🔗 Found ${mapping.increments.length} related increments`);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
// 3. Build enhanced spec content
|
|
67
|
-
const taskMapping = buildTaskMapping(mapping.increments);
|
|
68
|
-
const architectureDocs = await findArchitectureDocs(rootDir, specId);
|
|
69
|
-
|
|
70
|
-
const enhancedSpec: EnhancedSpecContent = {
|
|
71
|
-
...baseSpec,
|
|
72
|
-
summary: baseSpec.description,
|
|
73
|
-
taskMapping,
|
|
74
|
-
architectureDocs
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
// 4. Build external description
|
|
78
|
-
const builder = new EnhancedContentBuilder();
|
|
79
|
-
const description = builder.buildExternalDescription(enhancedSpec);
|
|
80
|
-
|
|
81
|
-
if (verbose) {
|
|
82
|
-
console.log(`📝 Generated description: ${description.length} characters`);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
if (dryRun) {
|
|
86
|
-
console.log('🔍 DRY RUN - Would create/update epic with:');
|
|
87
|
-
console.log(` Summary: ${baseSpec.title}`);
|
|
88
|
-
console.log(` Description length: ${description.length}`);
|
|
89
|
-
return {
|
|
90
|
-
success: true,
|
|
91
|
-
action: 'no-change',
|
|
92
|
-
tasksLinked: taskMapping?.tasks.length || 0
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
// 5. Validate domain/project (if not dry run)
|
|
97
|
-
if (!dryRun && (!domain || !project)) {
|
|
98
|
-
return {
|
|
99
|
-
success: false,
|
|
100
|
-
action: 'error',
|
|
101
|
-
error: 'JIRA domain/project not specified (required for actual sync)',
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
// For now, we focus on content building
|
|
106
|
-
// Actual JIRA API integration is in jira-spec-sync.ts
|
|
107
|
-
const result: EnhancedJiraSyncResult = {
|
|
108
|
-
success: true,
|
|
109
|
-
action: dryRun ? 'no-change' : 'created', // Assume create if not dry run
|
|
110
|
-
tasksLinked: taskMapping?.tasks.length || 0
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
if (domain && project && !dryRun) {
|
|
114
|
-
// In a real implementation, this would use JIRA API
|
|
115
|
-
// For now, just simulate success
|
|
116
|
-
result.epicKey = `SPEC-001`; // Placeholder
|
|
117
|
-
result.epicUrl = `https://${domain}/browse/SPEC-001`;
|
|
118
|
-
|
|
119
|
-
if (verbose) {
|
|
120
|
-
console.log(`⚠️ JIRA API integration not implemented in this file`);
|
|
121
|
-
console.log(` Use jira-spec-sync.ts for actual JIRA synchronization`);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
return result;
|
|
126
|
-
} catch (error: any) {
|
|
127
|
-
return {
|
|
128
|
-
success: false,
|
|
129
|
-
action: 'error',
|
|
130
|
-
error: error.message
|
|
131
|
-
};
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
// Helper functions (similar to GitHub sync)
|
|
136
|
-
|
|
137
|
-
async function findSpecWeaveRoot(specPath: string): Promise<string> {
|
|
138
|
-
let currentDir = path.dirname(specPath);
|
|
139
|
-
|
|
140
|
-
while (true) {
|
|
141
|
-
const specweaveDir = path.join(currentDir, '.specweave');
|
|
142
|
-
try {
|
|
143
|
-
await fs.access(specweaveDir);
|
|
144
|
-
return currentDir;
|
|
145
|
-
} catch {
|
|
146
|
-
const parentDir = path.dirname(currentDir);
|
|
147
|
-
if (parentDir === currentDir) {
|
|
148
|
-
throw new Error('.specweave directory not found');
|
|
149
|
-
}
|
|
150
|
-
currentDir = parentDir;
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
function buildTaskMapping(increments: any[]): any {
|
|
156
|
-
if (increments.length === 0) return undefined;
|
|
157
|
-
|
|
158
|
-
const firstIncrement = increments[0];
|
|
159
|
-
const tasks = firstIncrement.tasks.map((task: TaskInfo) => ({
|
|
160
|
-
id: task.id,
|
|
161
|
-
title: task.title,
|
|
162
|
-
userStories: task.userStories
|
|
163
|
-
}));
|
|
164
|
-
|
|
165
|
-
return {
|
|
166
|
-
incrementId: firstIncrement.id,
|
|
167
|
-
tasks,
|
|
168
|
-
tasksUrl: `tasks.md` // JIRA doesn't support external links in same way
|
|
169
|
-
};
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
async function findArchitectureDocs(rootDir: string, specId: string): Promise<any[]> {
|
|
173
|
-
const docs: any[] = [];
|
|
174
|
-
const archDir = path.join(rootDir, '.specweave/docs/internal/architecture');
|
|
175
|
-
|
|
176
|
-
try {
|
|
177
|
-
const adrDir = path.join(archDir, 'adr');
|
|
178
|
-
try {
|
|
179
|
-
const adrs = await fs.readdir(adrDir);
|
|
180
|
-
const relatedAdrs = adrs.filter(file => file.includes(specId.replace('spec-', '')));
|
|
181
|
-
|
|
182
|
-
for (const adr of relatedAdrs) {
|
|
183
|
-
docs.push({
|
|
184
|
-
type: 'adr',
|
|
185
|
-
path: path.join(adrDir, adr),
|
|
186
|
-
title: adr.replace('.md', '').replace(/-/g, ' ')
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
} catch {}
|
|
190
|
-
} catch {}
|
|
191
|
-
|
|
192
|
-
return docs;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
// NOTE: findExistingEpic not needed in this simplified version
|
|
196
|
-
// Real JIRA API integration is in jira-spec-sync.ts
|