specweave 0.34.5 → 0.34.8

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 (181) hide show
  1. package/bin/fix-marketplace-errors.sh +55 -7
  2. package/dist/plugins/specweave-github/lib/github-feature-sync.d.ts.map +1 -1
  3. package/dist/plugins/specweave-github/lib/github-feature-sync.js +3 -1
  4. package/dist/plugins/specweave-github/lib/github-feature-sync.js.map +1 -1
  5. package/dist/plugins/specweave-github/lib/github-spec-sync.js +1 -1
  6. package/dist/plugins/specweave-github/lib/github-spec-sync.js.map +1 -1
  7. package/dist/src/cli/commands/import-docs.d.ts +3 -0
  8. package/dist/src/cli/commands/import-docs.d.ts.map +1 -1
  9. package/dist/src/cli/commands/import-docs.js +110 -91
  10. package/dist/src/cli/commands/import-docs.js.map +1 -1
  11. package/dist/src/cli/commands/init.d.ts.map +1 -1
  12. package/dist/src/cli/commands/init.js +16 -7
  13. package/dist/src/cli/commands/init.js.map +1 -1
  14. package/dist/src/cli/commands/living-docs.js +4 -4
  15. package/dist/src/cli/commands/living-docs.js.map +1 -1
  16. package/dist/src/cli/commands/sync-spec-commits.js +1 -1
  17. package/dist/src/cli/commands/sync-spec-commits.js.map +1 -1
  18. package/dist/src/cli/commands/sync-spec-content.js +1 -1
  19. package/dist/src/cli/commands/sync-spec-content.js.map +1 -1
  20. package/dist/src/cli/helpers/github/increment-profile-selector.js +1 -1
  21. package/dist/src/cli/helpers/github/increment-profile-selector.js.map +1 -1
  22. package/dist/src/cli/helpers/github/profile-manager.d.ts +5 -5
  23. package/dist/src/cli/helpers/github/profile-manager.d.ts.map +1 -1
  24. package/dist/src/cli/helpers/github/profile-manager.js +24 -24
  25. package/dist/src/cli/helpers/github/profile-manager.js.map +1 -1
  26. package/dist/src/cli/helpers/init/brownfield-analysis.js +15 -15
  27. package/dist/src/cli/helpers/init/brownfield-analysis.js.map +1 -1
  28. package/dist/src/cli/helpers/init/config-detection.js +1 -1
  29. package/dist/src/cli/helpers/init/config-detection.js.map +1 -1
  30. package/dist/src/cli/helpers/init/living-docs-preflight.js +7 -7
  31. package/dist/src/cli/helpers/init/living-docs-preflight.js.map +1 -1
  32. package/dist/src/cli/helpers/init/plugin-installer.d.ts.map +1 -1
  33. package/dist/src/cli/helpers/init/plugin-installer.js +61 -9
  34. package/dist/src/cli/helpers/init/plugin-installer.js.map +1 -1
  35. package/dist/src/cli/helpers/init/sync-profile-helpers.d.ts.map +1 -1
  36. package/dist/src/cli/helpers/init/sync-profile-helpers.js +2 -4
  37. package/dist/src/cli/helpers/init/sync-profile-helpers.js.map +1 -1
  38. package/dist/src/cli/helpers/issue-tracker/ado-area-selection.d.ts +1 -4
  39. package/dist/src/cli/helpers/issue-tracker/ado-area-selection.d.ts.map +1 -1
  40. package/dist/src/cli/helpers/issue-tracker/ado-area-selection.js +0 -32
  41. package/dist/src/cli/helpers/issue-tracker/ado-area-selection.js.map +1 -1
  42. package/dist/src/cli/helpers/issue-tracker/ado.d.ts.map +1 -1
  43. package/dist/src/cli/helpers/issue-tracker/ado.js +3 -13
  44. package/dist/src/cli/helpers/issue-tracker/ado.js.map +1 -1
  45. package/dist/src/cli/helpers/issue-tracker/index.d.ts.map +1 -1
  46. package/dist/src/cli/helpers/issue-tracker/index.js +0 -1
  47. package/dist/src/cli/helpers/issue-tracker/index.js.map +1 -1
  48. package/dist/src/cli/helpers/issue-tracker/sync-config-writer.d.ts.map +1 -1
  49. package/dist/src/cli/helpers/issue-tracker/sync-config-writer.js +0 -7
  50. package/dist/src/cli/helpers/issue-tracker/sync-config-writer.js.map +1 -1
  51. package/dist/src/cli/helpers/issue-tracker/types.d.ts +1 -5
  52. package/dist/src/cli/helpers/issue-tracker/types.d.ts.map +1 -1
  53. package/dist/src/cli/helpers/issue-tracker/types.js.map +1 -1
  54. package/dist/src/cli/workers/import-worker.js +5 -111
  55. package/dist/src/cli/workers/import-worker.js.map +1 -1
  56. package/dist/src/core/background/types.d.ts +3 -0
  57. package/dist/src/core/background/types.d.ts.map +1 -1
  58. package/dist/src/core/config/types.d.ts +0 -5
  59. package/dist/src/core/config/types.d.ts.map +1 -1
  60. package/dist/src/core/config/types.js.map +1 -1
  61. package/dist/src/core/increment/increment-archiver.d.ts.map +1 -1
  62. package/dist/src/core/increment/increment-archiver.js +0 -6
  63. package/dist/src/core/increment/increment-archiver.js.map +1 -1
  64. package/dist/src/core/increment/increment-utils.d.ts +0 -4
  65. package/dist/src/core/increment/increment-utils.d.ts.map +1 -1
  66. package/dist/src/core/increment/increment-utils.js +0 -6
  67. package/dist/src/core/increment/increment-utils.js.map +1 -1
  68. package/dist/src/core/living-docs/cross-project-sync.d.ts +0 -13
  69. package/dist/src/core/living-docs/cross-project-sync.d.ts.map +1 -1
  70. package/dist/src/core/living-docs/cross-project-sync.js +0 -25
  71. package/dist/src/core/living-docs/cross-project-sync.js.map +1 -1
  72. package/dist/src/core/living-docs/delivery/delivery-generator.d.ts +58 -0
  73. package/dist/src/core/living-docs/delivery/delivery-generator.d.ts.map +1 -0
  74. package/dist/src/core/living-docs/delivery/delivery-generator.js +501 -0
  75. package/dist/src/core/living-docs/delivery/delivery-generator.js.map +1 -0
  76. package/dist/src/core/living-docs/delivery/index.d.ts +8 -0
  77. package/dist/src/core/living-docs/delivery/index.d.ts.map +1 -0
  78. package/dist/src/core/living-docs/delivery/index.js +7 -0
  79. package/dist/src/core/living-docs/delivery/index.js.map +1 -0
  80. package/dist/src/core/living-docs/diagrams/index.d.ts +8 -0
  81. package/dist/src/core/living-docs/diagrams/index.d.ts.map +1 -0
  82. package/dist/src/core/living-docs/diagrams/index.js +7 -0
  83. package/dist/src/core/living-docs/diagrams/index.js.map +1 -0
  84. package/dist/src/core/living-docs/diagrams/mermaid-generator.d.ts +103 -0
  85. package/dist/src/core/living-docs/diagrams/mermaid-generator.d.ts.map +1 -0
  86. package/dist/src/core/living-docs/diagrams/mermaid-generator.js +515 -0
  87. package/dist/src/core/living-docs/diagrams/mermaid-generator.js.map +1 -0
  88. package/dist/src/core/living-docs/enterprise/enterprise-generator.d.ts +85 -0
  89. package/dist/src/core/living-docs/enterprise/enterprise-generator.d.ts.map +1 -0
  90. package/dist/src/core/living-docs/enterprise/enterprise-generator.js +556 -0
  91. package/dist/src/core/living-docs/enterprise/enterprise-generator.js.map +1 -0
  92. package/dist/src/core/living-docs/enterprise/history-analyzer.d.ts +91 -0
  93. package/dist/src/core/living-docs/enterprise/history-analyzer.d.ts.map +1 -0
  94. package/dist/src/core/living-docs/enterprise/history-analyzer.js +321 -0
  95. package/dist/src/core/living-docs/enterprise/history-analyzer.js.map +1 -0
  96. package/dist/src/core/living-docs/enterprise/index.d.ts +18 -0
  97. package/dist/src/core/living-docs/enterprise/index.d.ts.map +1 -0
  98. package/dist/src/core/living-docs/enterprise/index.js +14 -0
  99. package/dist/src/core/living-docs/enterprise/index.js.map +1 -0
  100. package/dist/src/core/living-docs/enterprise/relationship-mapper.d.ts +58 -0
  101. package/dist/src/core/living-docs/enterprise/relationship-mapper.d.ts.map +1 -0
  102. package/dist/src/core/living-docs/enterprise/relationship-mapper.js +227 -0
  103. package/dist/src/core/living-docs/enterprise/relationship-mapper.js.map +1 -0
  104. package/dist/src/core/living-docs/enterprise/spec-loader.d.ts +161 -0
  105. package/dist/src/core/living-docs/enterprise/spec-loader.d.ts.map +1 -0
  106. package/dist/src/core/living-docs/enterprise/spec-loader.js +470 -0
  107. package/dist/src/core/living-docs/enterprise/spec-loader.js.map +1 -0
  108. package/dist/src/core/living-docs/intelligent-analyzer/inconsistency-detector.d.ts +31 -1
  109. package/dist/src/core/living-docs/intelligent-analyzer/inconsistency-detector.d.ts.map +1 -1
  110. package/dist/src/core/living-docs/intelligent-analyzer/inconsistency-detector.js +626 -14
  111. package/dist/src/core/living-docs/intelligent-analyzer/inconsistency-detector.js.map +1 -1
  112. package/dist/src/core/living-docs/intelligent-analyzer/index.d.ts +8 -0
  113. package/dist/src/core/living-docs/intelligent-analyzer/index.d.ts.map +1 -1
  114. package/dist/src/core/living-docs/intelligent-analyzer/index.js +87 -4
  115. package/dist/src/core/living-docs/intelligent-analyzer/index.js.map +1 -1
  116. package/dist/src/core/living-docs/intelligent-analyzer/types.d.ts +3 -1
  117. package/dist/src/core/living-docs/intelligent-analyzer/types.d.ts.map +1 -1
  118. package/dist/src/core/living-docs/living-docs-sync.js +1 -1
  119. package/dist/src/core/living-docs/living-docs-sync.js.map +1 -1
  120. package/dist/src/core/living-docs/operations/index.d.ts +8 -0
  121. package/dist/src/core/living-docs/operations/index.d.ts.map +1 -0
  122. package/dist/src/core/living-docs/operations/index.js +7 -0
  123. package/dist/src/core/living-docs/operations/index.js.map +1 -0
  124. package/dist/src/core/living-docs/operations/ops-generator.d.ts +53 -0
  125. package/dist/src/core/living-docs/operations/ops-generator.d.ts.map +1 -0
  126. package/dist/src/core/living-docs/operations/ops-generator.js +462 -0
  127. package/dist/src/core/living-docs/operations/ops-generator.js.map +1 -0
  128. package/dist/src/core/project/project-manager.d.ts +0 -20
  129. package/dist/src/core/project/project-manager.d.ts.map +1 -1
  130. package/dist/src/core/project/project-manager.js +0 -49
  131. package/dist/src/core/project/project-manager.js.map +1 -1
  132. package/dist/src/core/repo-structure/prompt-consolidator.d.ts +0 -8
  133. package/dist/src/core/repo-structure/prompt-consolidator.d.ts.map +1 -1
  134. package/dist/src/core/repo-structure/prompt-consolidator.js +0 -28
  135. package/dist/src/core/repo-structure/prompt-consolidator.js.map +1 -1
  136. package/dist/src/core/sync/profile-manager.d.ts +5 -5
  137. package/dist/src/core/sync/profile-manager.d.ts.map +1 -1
  138. package/dist/src/core/sync/profile-manager.js +17 -17
  139. package/dist/src/core/sync/profile-manager.js.map +1 -1
  140. package/dist/src/core/types/sync-profile.d.ts +3 -20
  141. package/dist/src/core/types/sync-profile.d.ts.map +1 -1
  142. package/dist/src/core/types/sync-profile.js +4 -10
  143. package/dist/src/core/types/sync-profile.js.map +1 -1
  144. package/dist/src/integrations/ado/ado-client-factory.d.ts +2 -2
  145. package/dist/src/integrations/ado/ado-client-factory.js +2 -2
  146. package/dist/src/utils/project-detection.d.ts +16 -16
  147. package/dist/src/utils/project-detection.d.ts.map +1 -1
  148. package/dist/src/utils/project-detection.js +39 -39
  149. package/dist/src/utils/project-detection.js.map +1 -1
  150. package/dist/src/utils/validators/ado-validator.d.ts +0 -5
  151. package/dist/src/utils/validators/ado-validator.d.ts.map +1 -1
  152. package/dist/src/utils/validators/ado-validator.js +0 -23
  153. package/dist/src/utils/validators/ado-validator.js.map +1 -1
  154. package/package.json +1 -1
  155. package/plugins/specweave/commands/living-docs.md +168 -39
  156. package/plugins/specweave-github/lib/github-feature-sync.js +1 -1
  157. package/plugins/specweave-github/lib/github-feature-sync.ts +3 -1
  158. package/plugins/specweave-github/lib/github-spec-sync.js +1 -1
  159. package/plugins/specweave-github/lib/github-spec-sync.ts +1 -1
  160. package/dist/plugins/specweave-github/lib/github-sync-bidirectional.d.ts +0 -45
  161. package/dist/plugins/specweave-github/lib/github-sync-bidirectional.d.ts.map +0 -1
  162. package/dist/plugins/specweave-github/lib/github-sync-bidirectional.js +0 -247
  163. package/dist/plugins/specweave-github/lib/github-sync-bidirectional.js.map +0 -1
  164. package/dist/src/core/brownfield/analyzer.d.ts +0 -86
  165. package/dist/src/core/brownfield/analyzer.d.ts.map +0 -1
  166. package/dist/src/core/brownfield/analyzer.js +0 -365
  167. package/dist/src/core/brownfield/analyzer.js.map +0 -1
  168. package/dist/src/core/brownfield/importer.d.ts +0 -76
  169. package/dist/src/core/brownfield/importer.d.ts.map +0 -1
  170. package/dist/src/core/brownfield/importer.js +0 -287
  171. package/dist/src/core/brownfield/importer.js.map +0 -1
  172. package/dist/src/utils/env-multi-project-parser.d.ts +0 -237
  173. package/dist/src/utils/env-multi-project-parser.d.ts.map +0 -1
  174. package/dist/src/utils/env-multi-project-parser.js +0 -426
  175. package/dist/src/utils/env-multi-project-parser.js.map +0 -1
  176. package/plugins/specweave-github/lib/github-sync-bidirectional.d.js +0 -0
  177. package/plugins/specweave-github/lib/github-sync-bidirectional.d.ts +0 -36
  178. package/plugins/specweave-github/lib/github-sync-bidirectional.d.ts.map +0 -1
  179. package/plugins/specweave-github/lib/github-sync-bidirectional.js +0 -206
  180. package/plugins/specweave-github/lib/github-sync-bidirectional.js.map +0 -1
  181. package/plugins/specweave-github/lib/github-sync-bidirectional.ts +0 -362
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: sw:living-docs
3
- description: Launch or resume Living Docs Builder independently. Generates documentation from codebase analysis with AI-powered insights.
3
+ description: Launch or resume Living Docs Builder independently. Generates comprehensive enterprise documentation from codebase analysis with AI-powered insights.
4
4
  usage: /sw:living-docs [--resume <jobId>] [--depth <level>] [--priority <modules>] [--sources <folders>] [--depends-on <jobIds>] [--foreground] [--full-scan]
5
5
  ---
6
6
 
@@ -17,6 +17,7 @@ Launch the Living Docs Builder independently of `specweave init`. This is essent
17
17
  - **On-demand analysis** - Re-analyze codebase after major changes
18
18
  - **Large brownfield projects** - Run targeted analysis on specific modules
19
19
  - **CI/CD integration** - Automate documentation generation
20
+ - **Enterprise knowledge base** - Generate comprehensive "wikipedia-style" documentation of your entire organization
20
21
 
21
22
  ---
22
23
 
@@ -32,7 +33,7 @@ Launch the Living Docs Builder independently of `specweave init`. This is essent
32
33
  | `--depends-on <jobIds>` | Wait for jobs before starting (comma-separated) |
33
34
  | `--foreground` | Run in current session instead of background |
34
35
  | `--force` | Force run even for greenfield projects |
35
- | `--full-scan` | **Force full deep scan** - All phases (repos, org, arch, inconsistencies, strategy) |
36
+ | `--full-scan` | **Force full enterprise scan** - All 8 phases including enterprise KB, delivery/ops docs, diagrams |
36
37
 
37
38
  ---
38
39
 
@@ -67,16 +68,17 @@ Launch the Living Docs Builder independently of `specweave init`. This is essent
67
68
  ### Quick Analysis (Non-Interactive)
68
69
 
69
70
  ```bash
70
- # Quick scan - 5-10 minutes
71
+ # Quick scan - basic structure + imports + tech detection + inconsistencies
71
72
  /sw:living-docs --depth quick
72
73
 
73
- # Standard analysis - 15-30 minutes
74
+ # Standard analysis - modules + dependencies + relationships + diagrams
74
75
  /sw:living-docs --depth standard --priority auth,payments
75
76
 
76
77
  # AI-powered deep analysis (FREE with MAX subscription)
77
78
  /sw:living-docs --depth deep-native --priority core,api
78
79
 
79
- # Force FULL deep scan (all phases: repos, org, arch, inconsistencies, strategy)
80
+ # FULL ENTERPRISE SCAN - All 8 phases (A through H)
81
+ # Generates complete knowledge base: company history, team structure, delivery docs, diagrams
80
82
  /sw:living-docs --full-scan
81
83
  ```
82
84
 
@@ -84,53 +86,131 @@ Launch the Living Docs Builder independently of `specweave init`. This is essent
84
86
 
85
87
  ## Analysis Depths
86
88
 
87
- | Depth | Duration | What It Does | Cost |
88
- |-------|----------|--------------|------|
89
- | `quick` | ~5-10 min | Structure scan + tech detection + imports map | Free |
90
- | `standard` | ~15-30 min | Module analysis + exports + dependencies | Free |
91
- | `deep-native` | Progress-based | ⭐ AI analysis using your MAX subscription - NO EXTRA COST! | FREE (MAX) |
92
- | `deep-interactive` | Session-based | AI analysis in current Claude Code session (pause/resume) | FREE (MAX) |
89
+ | Depth | Scope | What It Does | Cost |
90
+ |-------|-------|--------------|------|
91
+ | `quick` | Core analysis | Structure scan + tech detection + imports map + inconsistency detection + basic diagrams | Free |
92
+ | `standard` | Full module analysis | Module deep-dive + exports + dependencies + relationships + team detection + Mermaid diagrams | Free |
93
+ | `deep-native` | Intelligent analysis | ⭐ AI-powered understanding: purpose extraction, pattern recognition, organization synthesis | FREE (MAX) |
94
+ | `deep-interactive` | Enterprise knowledge | AI analysis in current session with full enterprise KB generation (checkpoint/resume) | FREE (MAX) |
93
95
 
94
- ### Full Scan Mode (--full-scan)
96
+ ### Quick Depth Features (Expanded)
95
97
 
96
- **What it does**: Forces a comprehensive deep analysis with ALL phases, regardless of brownfield detection.
98
+ Quick mode now includes:
99
+ - File structure discovery across all repos
100
+ - Technology stack detection (frameworks, languages, tools)
101
+ - Import/export dependency mapping
102
+ - **Basic inconsistency detection** (duplicates, naming issues)
103
+ - **Basic Mermaid diagrams** (module structure, imports)
104
+ - External specification loading (GitHub/JIRA/ADO imports)
105
+
106
+ ### Standard Depth Features (Expanded)
107
+
108
+ Standard mode adds:
109
+ - Deep module analysis with exports/APIs
110
+ - Cross-module dependency graphs
111
+ - **Team structure inference** from code ownership
112
+ - **Relationship mapping** (feature-to-code, team-to-features)
113
+ - **Full Mermaid diagram suite** (org charts, dependencies, timelines)
114
+ - Basic architecture detection (patterns, ADR candidates)
115
+ - Spec-code gap detection
116
+
117
+ ### Full Scan Mode (--full-scan) - Enterprise Knowledge Base
118
+
119
+ **What it does**: Forces a comprehensive deep analysis through **ALL 8 PHASES (A-H)**, generating a complete enterprise knowledge base that serves as a "living wikipedia" for your organization.
97
120
 
98
121
  **When to use**:
99
122
  - Initial setup - want complete documentation structure
100
123
  - After major refactoring - need fresh analysis of everything
101
124
  - Imported external repos - want full org structure, inconsistencies, strategy docs
102
- - Complete living docs - need `review-needed/` and `strategy/` folders populated
125
+ - Enterprise documentation - need company history, team directory, delivery docs
126
+ - Complete living docs - all folders populated with cross-referenced documentation
103
127
 
104
- **What you get** (beyond standard depths):
128
+ **Duration**: Variable based on project size and complexity. For large enterprise projects (50+ repos, 247+ microservices), **expect this to run over multiple sessions spanning days or weeks**. The checkpoint/resume system ensures no work is lost.
129
+
130
+ **What you get** (complete enterprise knowledge base):
105
131
  ```
106
132
  .specweave/docs/internal/
107
- ├── repos/ # All repos analyzed (Phase B)
133
+ ├── repos/ # Per-repo analysis (Phase B)
108
134
  │ └── {repo-name}/
109
- │ ├── overview.md
110
- │ └── api-surface.md
135
+ │ ├── overview.md # Purpose, key concepts, patterns
136
+ │ └── api-surface.md # All public APIs documented
137
+
111
138
  ├── organization/ # Team structure (Phase C)
112
139
  │ ├── teams/
113
- │ └── org-chart.mmd
140
+ └── {team-name}.md # Responsibilities, expertise, tech stack
141
+ │ ├── microservices/ # Service boundaries
142
+ │ ├── domains/ # Domain groupings
143
+ │ └── org-synthesis.md # Organization overview
144
+
114
145
  ├── architecture/ # System architecture (Phase D)
115
- │ ├── adr/ # Auto-detected ADRs
116
- │ └── system-architecture.md
117
- ├── review-needed/ # Inconsistencies (Phase E) ✨
118
- ├── questions-for-cto.md
119
- ├── questions-for-po.md
120
- │ └── inconsistencies.md
121
- └── strategy/ # Strategic recommendations (Phase F) ✨
122
- ├── tech-debt-catalog.md
123
- ├── modernization-candidates.md
124
- └── recommendations.md
146
+ │ ├── adr/ # Auto-detected ADRs with evidence
147
+ └── 0001-pattern-name.md
148
+ ├── system-architecture.md # High-level architecture
149
+ └── c4-diagrams/ # C4 model diagrams
150
+
151
+ ├── review-needed/ # Categorized issues (Phase E) ✨
152
+ │ ├── index.md # Overview with priority summary
153
+ ├── CRITICAL-ISSUES.md # P0: Must fix immediately
154
+ ├── BROKEN-LINKS.md # All broken references
155
+ │ ├── SPEC-CODE-GAPS.md # Ghost completions, missing impl
156
+ │ ├── ORPHANED-DOCS.md # Docs without owners
157
+ │ └── tech-debt-catalog.md # Categorized tech debt
158
+
159
+ ├── strategy/ # Strategic recommendations (Phase F) ✨
160
+ │ ├── recommendations.md # Prioritized action items
161
+ │ ├── modernization.md # Migration/upgrade candidates
162
+ │ └── risk-assessment.md # Security and compliance risks
163
+
164
+ ├── enterprise/ # Enterprise KB (Phase G) ✨✨ NEW
165
+ │ ├── COMPANY-HISTORY.md # Timeline of project evolution
166
+ │ ├── FEATURE-CATALOG.md # All features with status/ownership
167
+ │ ├── TEAM-DIRECTORY.md # Team roster with expertise areas
168
+ │ └── PROJECT-METRICS.md # Stats: features, completions, velocity
169
+
170
+ ├── delivery/ # Delivery documentation (Phase G) ✨✨ NEW
171
+ │ ├── RELEASE-HISTORY.md # All releases with changelogs
172
+ │ ├── CI-CD-PIPELINE.md # Pipeline documentation
173
+ │ ├── DEPLOYMENT-GUIDE.md # How to deploy
174
+ │ └── ENVIRONMENTS.md # Environment configurations
175
+
176
+ ├── operations/ # Ops documentation (Phase G) ✨✨ NEW
177
+ │ ├── RUNBOOKS.md # Operational procedures
178
+ │ ├── MONITORING.md # What to monitor
179
+ │ ├── INCIDENT-HISTORY.md # Past incidents (if any)
180
+ │ └── SLA-TRACKING.md # Service level targets
181
+
182
+ ├── relationships/ # Cross-references (Phase G) ✨✨ NEW
183
+ │ ├── FEATURE-TO-CODE.md # Feature → file mappings
184
+ │ ├── TEAM-TO-FEATURES.md # Team → owned features
185
+ │ ├── MODULE-DEPENDENCIES.md # Module → module deps
186
+ │ └── EXTERNAL-REFS.md # External tool linkages
187
+
188
+ └── diagrams/ # Mermaid diagrams (Phase H) ✨✨ NEW
189
+ ├── feature-hierarchy.md # Feature tree visualization
190
+ ├── team-org-chart.md # Team structure
191
+ ├── module-dependencies.md # Dependency graph
192
+ ├── project-timeline.md # Gantt chart of evolution
193
+ ├── system-architecture.md # C4 context diagram
194
+ └── feature-status.md # Pie chart of completion
125
195
  ```
126
196
 
127
197
  **Command**:
128
198
  ```bash
129
199
  /sw:living-docs --full-scan
130
200
 
131
- # Uses deep-native if Claude MAX available, otherwise fails with error
132
- # Runs ALL phases: B → C → D → E → F
133
- # Duration: Variable (depends on project size)
201
+ # Uses deep-native (Claude MAX) for AI-powered analysis
202
+ # Runs ALL 8 phases: A → B → C → D → E → F → G → H
203
+ # Checkpoint/resume: Can stop and continue from any phase
204
+ # Enterprise projects: May take multiple sessions (days/weeks)
205
+ ```
206
+
207
+ **Resume after interruption**:
208
+ ```bash
209
+ # Check progress
210
+ /sw:jobs
211
+
212
+ # Resume from checkpoint (all previous work preserved)
213
+ /sw:living-docs --resume <jobId>
134
214
  ```
135
215
 
136
216
  ### Deep-Native (Recommended for MAX Users)
@@ -150,6 +230,27 @@ Uses your Claude MAX subscription via `claude --print`:
150
230
 
151
231
  ---
152
232
 
233
+ ## The 8 Phases of Enterprise Analysis
234
+
235
+ Full scan (`--full-scan`) executes all 8 phases sequentially with checkpoint/resume support:
236
+
237
+ | Phase | Name | What It Does | Output |
238
+ |-------|------|--------------|--------|
239
+ | **A** | Discovery | Scan file structure, detect repos, identify entry points | Internal state |
240
+ | **B** | Deep Analysis | AI-powered per-repo understanding: purpose, concepts, APIs, patterns | `repos/{name}/overview.md`, `api-surface.md` |
241
+ | **C** | Org Synthesis | Infer team structure, microservices, domains from code patterns | `organization/teams/`, `microservices/`, `domains/` |
242
+ | **D** | Architecture | Detect architectural decisions, generate ADRs, system diagrams | `architecture/adr/`, `system-architecture.md` |
243
+ | **E** | Inconsistencies | Find issues: broken links, spec-code gaps, orphaned docs, duplicates | `review-needed/CRITICAL-ISSUES.md`, `BROKEN-LINKS.md`, etc. |
244
+ | **F** | Strategy | Generate recommendations, tech debt catalog, modernization roadmap | `strategy/recommendations.md`, `tech-debt-catalog.md` |
245
+ | **G** | Enterprise | Build knowledge base: history, feature catalog, delivery docs, runbooks | `enterprise/`, `delivery/`, `operations/`, `relationships/` |
246
+ | **H** | Diagrams | Generate Mermaid visualizations: org charts, dependencies, timelines | `diagrams/*.md` |
247
+
248
+ **Checkpoint/Resume**: Each phase completion is checkpointed. If interrupted, resume continues from the last completed phase - no work is lost.
249
+
250
+ **Enterprise Scale**: For large organizations (50+ repos), phases B-G may each take significant time. The system is designed for long-running analysis that spans multiple sessions.
251
+
252
+ ---
253
+
153
254
  ## Implementation Steps
154
255
 
155
256
  When this command is invoked:
@@ -307,7 +408,9 @@ After completion, you'll see a detailed summary showing:
307
408
 
308
409
  ## Output Files
309
410
 
310
- After completion:
411
+ After completion (varies by depth):
412
+
413
+ ### Core Output (All Depths)
311
414
 
312
415
  | File | Description |
313
416
  |------|-------------|
@@ -317,6 +420,26 @@ After completion:
317
420
  | `.specweave/docs/overview/TECH-STACK.md` | Detected technologies and frameworks |
318
421
  | `.specweave/docs/modules/*.md` | Per-module documentation |
319
422
 
423
+ ### Standard+ Output
424
+
425
+ | Folder | Description |
426
+ |--------|-------------|
427
+ | `.specweave/docs/internal/organization/` | Team structure, microservices, domains |
428
+ | `.specweave/docs/internal/relationships/` | Feature-to-code, team-to-features mappings |
429
+ | `.specweave/docs/internal/diagrams/` | Mermaid diagrams for visual navigation |
430
+
431
+ ### Full Scan Output (Enterprise KB)
432
+
433
+ | Folder | Description |
434
+ |--------|-------------|
435
+ | `.specweave/docs/internal/repos/` | Per-repo deep analysis with APIs |
436
+ | `.specweave/docs/internal/architecture/` | ADRs, system architecture, C4 diagrams |
437
+ | `.specweave/docs/internal/review-needed/` | Categorized issues (P0-P3) with remediation |
438
+ | `.specweave/docs/internal/strategy/` | Recommendations, modernization, risk assessment |
439
+ | `.specweave/docs/internal/enterprise/` | Company history, feature catalog, team directory |
440
+ | `.specweave/docs/internal/delivery/` | CI/CD, releases, deployment guides |
441
+ | `.specweave/docs/internal/operations/` | Runbooks, monitoring, SLAs |
442
+
320
443
  ---
321
444
 
322
445
  ## Examples
@@ -339,16 +462,22 @@ After completion:
339
462
  # Continuing from: payments-service
340
463
  ```
341
464
 
342
- ### Example 2: Large Brownfield (247 repos)
465
+ ### Example 2: Large Enterprise (247 repos)
343
466
 
344
467
  ```bash
345
- # Focus on critical modules first
346
- /sw:living-docs --depth deep-native \
347
- --priority auth,payments,billing,core \
348
- --depends-on clone-main123
468
+ # Full enterprise scan - generates complete knowledge base
469
+ # For large projects, this runs across multiple sessions
470
+ /sw:living-docs --full-scan --depends-on clone-main123
349
471
 
350
- # Monitor in another terminal
472
+ # Monitor progress (runs in background, survives terminal close)
351
473
  /sw:jobs --follow ldb-xyz789
474
+
475
+ # Resume after interruption (all progress preserved)
476
+ /sw:living-docs --resume ldb-xyz789
477
+
478
+ # Alternatively: Focus on critical modules first (faster initial pass)
479
+ /sw:living-docs --depth standard \
480
+ --priority auth,payments,billing,core
352
481
  ```
353
482
 
354
483
  ### Example 3: CI/CD Integration
@@ -243,7 +243,7 @@ const _GitHubFeatureSync = class _GitHubFeatureSync {
243
243
  const title = `${featureData.id}: ${featureData.title}`;
244
244
  const existingResult = await execFileNoThrow("gh", [
245
245
  "api",
246
- "repos/:owner/:repo/milestones",
246
+ "repos/:owner/:repo/milestones?per_page=100&state=all",
247
247
  "--jq",
248
248
  `.[] | select(.title == "${title}") | {number, html_url}`
249
249
  ], { env: this.getGhEnv() });
@@ -403,9 +403,11 @@ export class GitHubFeatureSync {
403
403
  const title = `${featureData.id}: ${featureData.title}`;
404
404
 
405
405
  // CRITICAL: Check if milestone already exists before creating
406
+ // NOTE: Must use per_page=100 to handle repos with 30+ milestones (GitHub default is 30)
407
+ // BUG FIX: Without pagination, milestone #31+ won't be found → false "not found" → HTTP 422 duplicate error
406
408
  const existingResult = await execFileNoThrow('gh', [
407
409
  'api',
408
- 'repos/:owner/:repo/milestones',
410
+ 'repos/:owner/:repo/milestones?per_page=100&state=all',
409
411
  '--jq',
410
412
  `.[] | select(.title == "${title}") | {number, html_url}`,
411
413
  ], { env: this.getGhEnv() });
@@ -42,7 +42,7 @@ class GitHubSpecSync {
42
42
  if (!project) {
43
43
  return null;
44
44
  }
45
- const profileId = project.defaultSyncProfile || config.activeProfile;
45
+ const profileId = project.defaultSyncProfile || config.defaultProfile;
46
46
  if (!profileId) {
47
47
  return null;
48
48
  }
@@ -143,7 +143,7 @@ export class GitHubSpecSync {
143
143
  }
144
144
 
145
145
  // Get profile from project's default sync profile
146
- const profileId = project.defaultSyncProfile || config.activeProfile;
146
+ const profileId = project.defaultSyncProfile || config.defaultProfile;
147
147
  if (!profileId) {
148
148
  return null;
149
149
  }
@@ -1,45 +0,0 @@
1
- /**
2
- * Bidirectional GitHub Sync
3
- *
4
- * @deprecated This module is deprecated as of v0.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
- export interface GitHubIssueState {
19
- number: number;
20
- title: string;
21
- body: string;
22
- state: 'open' | 'closed';
23
- labels: string[];
24
- assignees: string[];
25
- milestone?: string;
26
- comments: GitHubComment[];
27
- updated_at: string;
28
- }
29
- export interface GitHubComment {
30
- id: number;
31
- author: string;
32
- body: string;
33
- created_at: string;
34
- }
35
- export interface SyncConflict {
36
- type: 'status' | 'assignee' | 'label';
37
- githubValue: any;
38
- specweaveValue: any;
39
- resolution: 'github-wins' | 'specweave-wins' | 'prompt';
40
- }
41
- /**
42
- * Sync from GitHub to SpecWeave
43
- */
44
- export declare function syncFromGitHub(incrementId: string): Promise<void>;
45
- //# sourceMappingURL=github-sync-bidirectional.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"github-sync-bidirectional.d.ts","sourceRoot":"","sources":["../../../../plugins/specweave-github/lib/github-sync-bidirectional.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAsBH,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,GAAG,QAAQ,CAAC;IACzB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,QAAQ,GAAG,UAAU,GAAG,OAAO,CAAC;IACtC,WAAW,EAAE,GAAG,CAAC;IACjB,cAAc,EAAE,GAAG,CAAC;IACpB,UAAU,EAAE,aAAa,GAAG,gBAAgB,GAAG,QAAQ,CAAC;CACzD;AAED;;GAEG;AACH,wBAAsB,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAmDvE"}
@@ -1,247 +0,0 @@
1
- /**
2
- * Bidirectional GitHub Sync
3
- *
4
- * @deprecated This module is deprecated as of v0.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
- import * as fs from '../../../src/utils/fs-native.js';
19
- import path from 'path';
20
- import { execFileNoThrow } from '../../../src/utils/execFileNoThrow.js';
21
- import { loadIncrementMetadata, detectRepo } from './github-issue-updater.js';
22
- import { getGitHubAuthFromProject } from '../../../src/utils/auth-helpers.js';
23
- /**
24
- * Get environment object with GH_TOKEN for gh CLI commands.
25
- */
26
- function getGhEnv() {
27
- const { token } = getGitHubAuthFromProject(process.cwd());
28
- return token
29
- ? { ...process.env, GH_TOKEN: token }
30
- : process.env;
31
- }
32
- /**
33
- * Sync from GitHub to SpecWeave
34
- */
35
- export async function syncFromGitHub(incrementId) {
36
- console.log(`\n🔄 Syncing from GitHub for increment: ${incrementId}`);
37
- try {
38
- // 1. Load metadata
39
- const metadata = await loadIncrementMetadata(incrementId);
40
- if (!metadata?.github?.issue) {
41
- console.log('ℹ️ No GitHub issue linked, nothing to sync');
42
- return;
43
- }
44
- // 2. Detect repository
45
- const repoInfo = await detectRepo();
46
- if (!repoInfo) {
47
- console.log('⚠️ Could not detect GitHub repository');
48
- return;
49
- }
50
- const { owner, repo } = repoInfo;
51
- const issueNumber = metadata.github.issue;
52
- console.log(` Syncing from ${owner}/${repo}#${issueNumber}`);
53
- // 3. Fetch current GitHub state
54
- const githubState = await fetchGitHubIssueState(issueNumber, owner, repo);
55
- // 4. Compare with local state
56
- const conflicts = detectConflicts(metadata, githubState);
57
- if (conflicts.length === 0) {
58
- console.log('✅ No conflicts - GitHub and SpecWeave in sync');
59
- return;
60
- }
61
- console.log(`⚠️ Detected ${conflicts.length} conflict(s)`);
62
- // 5. Resolve conflicts
63
- await resolveConflicts(incrementId, metadata, githubState, conflicts);
64
- // 6. Sync comments
65
- await syncComments(incrementId, githubState.comments);
66
- // 7. Update metadata
67
- await updateMetadata(incrementId, githubState);
68
- console.log('✅ Three-permission sync complete');
69
- }
70
- catch (error) {
71
- console.error('❌ Error syncing from GitHub:', error);
72
- throw error;
73
- }
74
- }
75
- /**
76
- * Fetch current GitHub issue state
77
- */
78
- async function fetchGitHubIssueState(issueNumber, owner, repo) {
79
- // Fetch issue details
80
- const issueResult = await execFileNoThrow('gh', [
81
- 'issue',
82
- 'view',
83
- String(issueNumber),
84
- '--repo',
85
- `${owner}/${repo}`,
86
- '--json',
87
- 'number,title,body,state,labels,assignees,milestone,updatedAt'
88
- ], { env: getGhEnv() });
89
- if (issueResult.exitCode !== 0) {
90
- throw new Error(`Failed to fetch issue: ${issueResult.stderr}`);
91
- }
92
- const issue = JSON.parse(issueResult.stdout);
93
- // Fetch comments
94
- const commentsResult = await execFileNoThrow('gh', [
95
- 'api',
96
- `repos/${owner}/${repo}/issues/${issueNumber}/comments`,
97
- '--jq',
98
- '.[] | {id: .id, author: .user.login, body: .body, created_at: .created_at}'
99
- ], { env: getGhEnv() });
100
- let comments = [];
101
- if (commentsResult.exitCode === 0 && commentsResult.stdout.trim()) {
102
- const commentLines = commentsResult.stdout.trim().split('\n');
103
- comments = commentLines.map(line => JSON.parse(line));
104
- }
105
- return {
106
- number: issue.number,
107
- title: issue.title,
108
- body: issue.body,
109
- state: issue.state,
110
- labels: issue.labels?.map((l) => l.name) || [],
111
- assignees: issue.assignees?.map((a) => a.login) || [],
112
- milestone: issue.milestone?.title,
113
- comments,
114
- updated_at: issue.updatedAt
115
- };
116
- }
117
- /**
118
- * Detect conflicts between GitHub and SpecWeave
119
- */
120
- function detectConflicts(metadata, githubState) {
121
- const conflicts = [];
122
- // Status conflict
123
- const specweaveStatus = metadata.status; // "active", "completed", "paused", "abandoned"
124
- const githubStatus = githubState.state; // "open", "closed"
125
- const expectedGitHubStatus = mapSpecWeaveStatusToGitHub(specweaveStatus);
126
- if (githubStatus !== expectedGitHubStatus) {
127
- conflicts.push({
128
- type: 'status',
129
- githubValue: githubStatus,
130
- specweaveValue: specweaveStatus,
131
- resolution: 'prompt' // Ask user
132
- });
133
- }
134
- // TODO: Add assignee/label conflicts if needed in future
135
- return conflicts;
136
- }
137
- /**
138
- * Resolve conflicts
139
- */
140
- async function resolveConflicts(incrementId, metadata, githubState, conflicts) {
141
- for (const conflict of conflicts) {
142
- console.log(`\n⚠️ Conflict detected: ${conflict.type}`);
143
- console.log(` GitHub: ${conflict.githubValue}`);
144
- console.log(` SpecWeave: ${conflict.specweaveValue}`);
145
- if (conflict.type === 'status') {
146
- await resolveStatusConflict(incrementId, metadata, githubState);
147
- }
148
- }
149
- }
150
- /**
151
- * Resolve status conflict
152
- */
153
- async function resolveStatusConflict(incrementId, metadata, githubState) {
154
- const specweaveStatus = metadata.status;
155
- const githubStatus = githubState.state;
156
- // GitHub closed but SpecWeave active
157
- if (githubStatus === 'closed' && specweaveStatus === 'active') {
158
- console.log(`\n⚠️ **CONFLICT**: GitHub issue closed but SpecWeave increment still active!`);
159
- console.log(` Recommendation: Run /sw:done ${incrementId} to close increment`);
160
- console.log(` Or reopen issue on GitHub if work is not complete`);
161
- }
162
- // GitHub open but SpecWeave completed
163
- if (githubStatus === 'open' && specweaveStatus === 'completed') {
164
- console.log(`\n⚠️ **CONFLICT**: SpecWeave increment completed but GitHub issue still open!`);
165
- console.log(` Recommendation: Close GitHub issue #${metadata.github.issue}`);
166
- }
167
- // GitHub open but SpecWeave paused
168
- if (githubStatus === 'open' && specweaveStatus === 'paused') {
169
- console.log(`\nℹ️ GitHub issue open, SpecWeave increment paused (OK)`);
170
- }
171
- // GitHub open but SpecWeave abandoned
172
- if (githubStatus === 'open' && specweaveStatus === 'abandoned') {
173
- console.log(`\n⚠️ **CONFLICT**: SpecWeave increment abandoned but GitHub issue still open!`);
174
- console.log(` Recommendation: Close GitHub issue #${metadata.github.issue} with reason`);
175
- }
176
- }
177
- /**
178
- * Sync comments from GitHub to SpecWeave
179
- */
180
- async function syncComments(incrementId, comments) {
181
- if (comments.length === 0) {
182
- console.log('ℹ️ No comments to sync');
183
- return;
184
- }
185
- const commentsPath = path.join(process.cwd(), '.specweave/increments', incrementId, 'logs/github-comments.md');
186
- await fs.ensureFile(commentsPath);
187
- // Load existing comments
188
- let existingContent = '';
189
- if (await fs.pathExists(commentsPath)) {
190
- existingContent = await fs.readFile(commentsPath, 'utf-8');
191
- }
192
- // Extract existing comment IDs
193
- const existingIds = new Set();
194
- const idMatches = existingContent.matchAll(/<!-- comment-id: (\d+) -->/g);
195
- for (const match of idMatches) {
196
- existingIds.add(parseInt(match[1], 10));
197
- }
198
- // Append new comments
199
- const newComments = comments.filter(c => !existingIds.has(c.id));
200
- if (newComments.length === 0) {
201
- console.log('ℹ️ All comments already synced');
202
- return;
203
- }
204
- console.log(`📝 Syncing ${newComments.length} new comment(s)`);
205
- const commentsMarkdown = newComments.map(comment => `
206
- ---
207
-
208
- <!-- comment-id: ${comment.id} -->
209
-
210
- **Author**: @${comment.author}
211
- **Date**: ${new Date(comment.created_at).toLocaleString()}
212
-
213
- ${comment.body}
214
- `.trim()).join('\n\n');
215
- await fs.appendFile(commentsPath, (existingContent ? '\n\n' : '') + commentsMarkdown);
216
- console.log(`✅ Comments saved to: logs/github-comments.md`);
217
- }
218
- /**
219
- * Update metadata with GitHub state
220
- */
221
- async function updateMetadata(incrementId, githubState) {
222
- const metadataPath = path.join(process.cwd(), '.specweave/increments', incrementId, 'metadata.json');
223
- const metadata = await fs.readJson(metadataPath);
224
- // Update GitHub section
225
- metadata.github = metadata.github || {};
226
- metadata.github.synced = new Date().toISOString();
227
- metadata.github.lastUpdated = githubState.updated_at;
228
- metadata.github.state = githubState.state;
229
- await fs.writeJson(metadataPath, metadata, { spaces: 2 });
230
- console.log('✅ Metadata updated');
231
- }
232
- /**
233
- * Map SpecWeave status to GitHub state
234
- */
235
- function mapSpecWeaveStatusToGitHub(status) {
236
- switch (status) {
237
- case 'completed':
238
- case 'abandoned':
239
- return 'closed';
240
- case 'active':
241
- case 'paused':
242
- case 'planning':
243
- default:
244
- return 'open';
245
- }
246
- }
247
- //# sourceMappingURL=github-sync-bidirectional.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"github-sync-bidirectional.js","sourceRoot":"","sources":["../../../../plugins/specweave-github/lib/github-sync-bidirectional.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,MAAM,iCAAiC,CAAC;AACtD,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,EACL,qBAAqB,EAErB,UAAU,EACX,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAE9E;;GAEG;AACH,SAAS,QAAQ;IACf,MAAM,EAAE,KAAK,EAAE,GAAG,wBAAwB,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IAC1D,OAAO,KAAK;QACV,CAAC,CAAC,EAAE,GAAG,OAAO,CAAC,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE;QACrC,CAAC,CAAC,OAAO,CAAC,G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