specweave 0.29.0 → 0.29.2

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 (87) hide show
  1. package/package.json +3 -1
  2. package/plugins/specweave-github/hooks/.specweave/logs/hooks-debug.log +18 -0
  3. package/plugins/specweave-release/hooks/.specweave/logs/dora-tracking.log +27 -0
  4. package/dist/plugins/specweave-github/lib/enhanced-github-sync.d.ts +0 -26
  5. package/dist/plugins/specweave-github/lib/enhanced-github-sync.d.ts.map +0 -1
  6. package/dist/plugins/specweave-github/lib/enhanced-github-sync.js +0 -249
  7. package/dist/plugins/specweave-github/lib/enhanced-github-sync.js.map +0 -1
  8. package/dist/plugins/specweave-jira/lib/enhanced-jira-sync.d.ts +0 -28
  9. package/dist/plugins/specweave-jira/lib/enhanced-jira-sync.d.ts.map +0 -1
  10. package/dist/plugins/specweave-jira/lib/enhanced-jira-sync.js +0 -156
  11. package/dist/plugins/specweave-jira/lib/enhanced-jira-sync.js.map +0 -1
  12. package/dist/src/core/sync/bidirectional-engine.d.ts +0 -119
  13. package/dist/src/core/sync/bidirectional-engine.d.ts.map +0 -1
  14. package/dist/src/core/sync/bidirectional-engine.js +0 -359
  15. package/dist/src/core/sync/bidirectional-engine.js.map +0 -1
  16. package/dist/src/core/sync/conflict-resolver.d.ts +0 -66
  17. package/dist/src/core/sync/conflict-resolver.d.ts.map +0 -1
  18. package/dist/src/core/sync/conflict-resolver.js +0 -108
  19. package/dist/src/core/sync/conflict-resolver.js.map +0 -1
  20. package/dist/src/core/sync/enhanced-content-builder.d.ts +0 -55
  21. package/dist/src/core/sync/enhanced-content-builder.d.ts.map +0 -1
  22. package/dist/src/core/sync/enhanced-content-builder.js +0 -203
  23. package/dist/src/core/sync/enhanced-content-builder.js.map +0 -1
  24. package/dist/src/core/sync/folder-mapper.d.ts +0 -71
  25. package/dist/src/core/sync/folder-mapper.d.ts.map +0 -1
  26. package/dist/src/core/sync/folder-mapper.js +0 -203
  27. package/dist/src/core/sync/folder-mapper.js.map +0 -1
  28. package/dist/src/core/sync/label-detector.d.ts +0 -66
  29. package/dist/src/core/sync/label-detector.d.ts.map +0 -1
  30. package/dist/src/core/sync/label-detector.js +0 -224
  31. package/dist/src/core/sync/label-detector.js.map +0 -1
  32. package/dist/src/core/sync/performance-optimizer.d.ts +0 -153
  33. package/dist/src/core/sync/performance-optimizer.d.ts.map +0 -1
  34. package/dist/src/core/sync/performance-optimizer.js +0 -220
  35. package/dist/src/core/sync/performance-optimizer.js.map +0 -1
  36. package/dist/src/core/sync/profile-selector.d.ts +0 -52
  37. package/dist/src/core/sync/profile-selector.d.ts.map +0 -1
  38. package/dist/src/core/sync/profile-selector.js +0 -179
  39. package/dist/src/core/sync/profile-selector.js.map +0 -1
  40. package/dist/src/core/sync/profile-validator.d.ts +0 -52
  41. package/dist/src/core/sync/profile-validator.d.ts.map +0 -1
  42. package/dist/src/core/sync/profile-validator.js +0 -170
  43. package/dist/src/core/sync/profile-validator.js.map +0 -1
  44. package/dist/src/core/sync/rate-limiter.d.ts +0 -116
  45. package/dist/src/core/sync/rate-limiter.d.ts.map +0 -1
  46. package/dist/src/core/sync/rate-limiter.js +0 -308
  47. package/dist/src/core/sync/rate-limiter.js.map +0 -1
  48. package/dist/src/core/sync/retry-handler.d.ts +0 -98
  49. package/dist/src/core/sync/retry-handler.d.ts.map +0 -1
  50. package/dist/src/core/sync/retry-handler.js +0 -196
  51. package/dist/src/core/sync/retry-handler.js.map +0 -1
  52. package/dist/src/core/sync/retry-logic.d.ts +0 -64
  53. package/dist/src/core/sync/retry-logic.d.ts.map +0 -1
  54. package/dist/src/core/sync/retry-logic.js +0 -165
  55. package/dist/src/core/sync/retry-logic.js.map +0 -1
  56. package/dist/src/core/sync/status-cache.d.ts +0 -91
  57. package/dist/src/core/sync/status-cache.d.ts.map +0 -1
  58. package/dist/src/core/sync/status-cache.js +0 -140
  59. package/dist/src/core/sync/status-cache.js.map +0 -1
  60. package/dist/src/core/sync/status-mapper.d.ts +0 -69
  61. package/dist/src/core/sync/status-mapper.d.ts.map +0 -1
  62. package/dist/src/core/sync/status-mapper.js +0 -90
  63. package/dist/src/core/sync/status-mapper.js.map +0 -1
  64. package/dist/src/core/sync/status-sync-engine.d.ts +0 -162
  65. package/dist/src/core/sync/status-sync-engine.d.ts.map +0 -1
  66. package/dist/src/core/sync/status-sync-engine.js +0 -347
  67. package/dist/src/core/sync/status-sync-engine.js.map +0 -1
  68. package/dist/src/core/sync/sync-event-logger.d.ts +0 -113
  69. package/dist/src/core/sync/sync-event-logger.d.ts.map +0 -1
  70. package/dist/src/core/sync/sync-event-logger.js +0 -141
  71. package/dist/src/core/sync/sync-event-logger.js.map +0 -1
  72. package/dist/src/core/sync/time-range-selector.d.ts +0 -48
  73. package/dist/src/core/sync/time-range-selector.d.ts.map +0 -1
  74. package/dist/src/core/sync/time-range-selector.js +0 -224
  75. package/dist/src/core/sync/time-range-selector.js.map +0 -1
  76. package/dist/src/core/sync/types.d.ts +0 -52
  77. package/dist/src/core/sync/types.d.ts.map +0 -1
  78. package/dist/src/core/sync/types.js +0 -5
  79. package/dist/src/core/sync/types.js.map +0 -1
  80. package/dist/src/core/sync/workflow-detector.d.ts +0 -95
  81. package/dist/src/core/sync/workflow-detector.d.ts.map +0 -1
  82. package/dist/src/core/sync/workflow-detector.js +0 -175
  83. package/dist/src/core/sync/workflow-detector.js.map +0 -1
  84. package/plugins/specweave-github/lib/enhanced-github-sync.js +0 -220
  85. package/plugins/specweave-github/lib/enhanced-github-sync.ts +0 -322
  86. package/plugins/specweave-jira/lib/enhanced-jira-sync.js +0 -134
  87. 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