@girardelli/architect 2.2.0 → 5.0.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.
Files changed (212) hide show
  1. package/README.md +105 -116
  2. package/architect-run.sh +431 -0
  3. package/assets/banner-v3.html +561 -0
  4. package/dist/agent-generator/context-enricher.d.ts +58 -0
  5. package/dist/agent-generator/context-enricher.d.ts.map +1 -0
  6. package/dist/agent-generator/context-enricher.js +613 -0
  7. package/dist/agent-generator/context-enricher.js.map +1 -0
  8. package/dist/agent-generator/domain-inferrer.d.ts +52 -0
  9. package/dist/agent-generator/domain-inferrer.d.ts.map +1 -0
  10. package/dist/agent-generator/domain-inferrer.js +585 -0
  11. package/dist/agent-generator/domain-inferrer.js.map +1 -0
  12. package/dist/agent-generator/framework-detector.d.ts +40 -0
  13. package/dist/agent-generator/framework-detector.d.ts.map +1 -0
  14. package/dist/agent-generator/framework-detector.js +611 -0
  15. package/dist/agent-generator/framework-detector.js.map +1 -0
  16. package/dist/agent-generator/index.d.ts +47 -0
  17. package/dist/agent-generator/index.d.ts.map +1 -0
  18. package/dist/agent-generator/index.js +545 -0
  19. package/dist/agent-generator/index.js.map +1 -0
  20. package/dist/agent-generator/stack-detector.d.ts +14 -0
  21. package/dist/agent-generator/stack-detector.d.ts.map +1 -0
  22. package/dist/agent-generator/stack-detector.js +124 -0
  23. package/dist/agent-generator/stack-detector.js.map +1 -0
  24. package/dist/agent-generator/templates/core/agents.d.ts +17 -0
  25. package/dist/agent-generator/templates/core/agents.d.ts.map +1 -0
  26. package/dist/agent-generator/templates/core/agents.js +1256 -0
  27. package/dist/agent-generator/templates/core/agents.js.map +1 -0
  28. package/dist/agent-generator/templates/core/architecture-rules.d.ts +7 -0
  29. package/dist/agent-generator/templates/core/architecture-rules.d.ts.map +1 -0
  30. package/dist/agent-generator/templates/core/architecture-rules.js +274 -0
  31. package/dist/agent-generator/templates/core/architecture-rules.js.map +1 -0
  32. package/dist/agent-generator/templates/core/general-rules.d.ts +8 -0
  33. package/dist/agent-generator/templates/core/general-rules.d.ts.map +1 -0
  34. package/dist/agent-generator/templates/core/general-rules.js +301 -0
  35. package/dist/agent-generator/templates/core/general-rules.js.map +1 -0
  36. package/dist/agent-generator/templates/core/hooks-generator.d.ts +21 -0
  37. package/dist/agent-generator/templates/core/hooks-generator.d.ts.map +1 -0
  38. package/dist/agent-generator/templates/core/hooks-generator.js +233 -0
  39. package/dist/agent-generator/templates/core/hooks-generator.js.map +1 -0
  40. package/dist/agent-generator/templates/core/index-md.d.ts +7 -0
  41. package/dist/agent-generator/templates/core/index-md.d.ts.map +1 -0
  42. package/dist/agent-generator/templates/core/index-md.js +246 -0
  43. package/dist/agent-generator/templates/core/index-md.js.map +1 -0
  44. package/dist/agent-generator/templates/core/orchestrator.d.ts +8 -0
  45. package/dist/agent-generator/templates/core/orchestrator.d.ts.map +1 -0
  46. package/dist/agent-generator/templates/core/orchestrator.js +422 -0
  47. package/dist/agent-generator/templates/core/orchestrator.js.map +1 -0
  48. package/dist/agent-generator/templates/core/preflight.d.ts +8 -0
  49. package/dist/agent-generator/templates/core/preflight.d.ts.map +1 -0
  50. package/dist/agent-generator/templates/core/preflight.js +213 -0
  51. package/dist/agent-generator/templates/core/preflight.js.map +1 -0
  52. package/dist/agent-generator/templates/core/quality-gates.d.ts +11 -0
  53. package/dist/agent-generator/templates/core/quality-gates.d.ts.map +1 -0
  54. package/dist/agent-generator/templates/core/quality-gates.js +254 -0
  55. package/dist/agent-generator/templates/core/quality-gates.js.map +1 -0
  56. package/dist/agent-generator/templates/core/security-rules.d.ts +7 -0
  57. package/dist/agent-generator/templates/core/security-rules.d.ts.map +1 -0
  58. package/dist/agent-generator/templates/core/security-rules.js +528 -0
  59. package/dist/agent-generator/templates/core/security-rules.js.map +1 -0
  60. package/dist/agent-generator/templates/core/skills-generator.d.ts +19 -0
  61. package/dist/agent-generator/templates/core/skills-generator.d.ts.map +1 -0
  62. package/dist/agent-generator/templates/core/skills-generator.js +546 -0
  63. package/dist/agent-generator/templates/core/skills-generator.js.map +1 -0
  64. package/dist/agent-generator/templates/core/workflow-fix-bug.d.ts +7 -0
  65. package/dist/agent-generator/templates/core/workflow-fix-bug.d.ts.map +1 -0
  66. package/dist/agent-generator/templates/core/workflow-fix-bug.js +237 -0
  67. package/dist/agent-generator/templates/core/workflow-fix-bug.js.map +1 -0
  68. package/dist/agent-generator/templates/core/workflow-new-feature.d.ts +8 -0
  69. package/dist/agent-generator/templates/core/workflow-new-feature.d.ts.map +1 -0
  70. package/dist/agent-generator/templates/core/workflow-new-feature.js +321 -0
  71. package/dist/agent-generator/templates/core/workflow-new-feature.js.map +1 -0
  72. package/dist/agent-generator/templates/core/workflow-review.d.ts +7 -0
  73. package/dist/agent-generator/templates/core/workflow-review.d.ts.map +1 -0
  74. package/dist/agent-generator/templates/core/workflow-review.js +104 -0
  75. package/dist/agent-generator/templates/core/workflow-review.js.map +1 -0
  76. package/dist/agent-generator/templates/domain/index.d.ts +22 -0
  77. package/dist/agent-generator/templates/domain/index.d.ts.map +1 -0
  78. package/dist/agent-generator/templates/domain/index.js +1176 -0
  79. package/dist/agent-generator/templates/domain/index.js.map +1 -0
  80. package/dist/agent-generator/templates/stack/index.d.ts +8 -0
  81. package/dist/agent-generator/templates/stack/index.d.ts.map +1 -0
  82. package/dist/agent-generator/templates/stack/index.js +695 -0
  83. package/dist/agent-generator/templates/stack/index.js.map +1 -0
  84. package/dist/agent-generator/templates/template-helpers.d.ts +75 -0
  85. package/dist/agent-generator/templates/template-helpers.d.ts.map +1 -0
  86. package/dist/agent-generator/templates/template-helpers.js +726 -0
  87. package/dist/agent-generator/templates/template-helpers.js.map +1 -0
  88. package/dist/agent-generator/types.d.ts +196 -0
  89. package/dist/agent-generator/types.d.ts.map +1 -0
  90. package/dist/agent-generator/types.js +27 -0
  91. package/dist/agent-generator/types.js.map +1 -0
  92. package/dist/analyzer.d.ts +5 -0
  93. package/dist/analyzer.d.ts.map +1 -1
  94. package/dist/analyzer.js +46 -5
  95. package/dist/analyzer.js.map +1 -1
  96. package/dist/analyzers/forecast.d.ts +85 -0
  97. package/dist/analyzers/forecast.d.ts.map +1 -0
  98. package/dist/analyzers/forecast.js +337 -0
  99. package/dist/analyzers/forecast.js.map +1 -0
  100. package/dist/analyzers/git-cache.d.ts +7 -0
  101. package/dist/analyzers/git-cache.d.ts.map +1 -0
  102. package/dist/analyzers/git-cache.js +41 -0
  103. package/dist/analyzers/git-cache.js.map +1 -0
  104. package/dist/analyzers/git-history.d.ts +113 -0
  105. package/dist/analyzers/git-history.d.ts.map +1 -0
  106. package/dist/analyzers/git-history.js +333 -0
  107. package/dist/analyzers/git-history.js.map +1 -0
  108. package/dist/analyzers/index.d.ts +10 -0
  109. package/dist/analyzers/index.d.ts.map +1 -0
  110. package/dist/analyzers/index.js +7 -0
  111. package/dist/analyzers/index.js.map +1 -0
  112. package/dist/analyzers/temporal-scorer.d.ts +72 -0
  113. package/dist/analyzers/temporal-scorer.d.ts.map +1 -0
  114. package/dist/analyzers/temporal-scorer.js +140 -0
  115. package/dist/analyzers/temporal-scorer.js.map +1 -0
  116. package/dist/anti-patterns.d.ts +7 -0
  117. package/dist/anti-patterns.d.ts.map +1 -1
  118. package/dist/anti-patterns.js +25 -6
  119. package/dist/anti-patterns.js.map +1 -1
  120. package/dist/cli.d.ts +2 -3
  121. package/dist/cli.d.ts.map +1 -1
  122. package/dist/cli.js +275 -113
  123. package/dist/cli.js.map +1 -1
  124. package/dist/config.d.ts +6 -0
  125. package/dist/config.d.ts.map +1 -1
  126. package/dist/config.js +48 -11
  127. package/dist/config.js.map +1 -1
  128. package/dist/html-reporter.d.ts +3 -1
  129. package/dist/html-reporter.d.ts.map +1 -1
  130. package/dist/html-reporter.js +248 -12
  131. package/dist/html-reporter.js.map +1 -1
  132. package/dist/index.d.ts +16 -3
  133. package/dist/index.d.ts.map +1 -1
  134. package/dist/index.js +63 -4
  135. package/dist/index.js.map +1 -1
  136. package/dist/project-summarizer.d.ts +38 -0
  137. package/dist/project-summarizer.d.ts.map +1 -0
  138. package/dist/project-summarizer.js +463 -0
  139. package/dist/project-summarizer.js.map +1 -0
  140. package/dist/refactor-reporter.js +1 -1
  141. package/dist/scanner.d.ts +8 -2
  142. package/dist/scanner.d.ts.map +1 -1
  143. package/dist/scanner.js +153 -113
  144. package/dist/scanner.js.map +1 -1
  145. package/dist/scorer.d.ts.map +1 -1
  146. package/dist/scorer.js +24 -11
  147. package/dist/scorer.js.map +1 -1
  148. package/dist/types.d.ts +29 -0
  149. package/dist/types.d.ts.map +1 -1
  150. package/package.json +12 -3
  151. package/src/agent-generator/context-enricher.ts +672 -0
  152. package/src/agent-generator/domain-inferrer.ts +635 -0
  153. package/src/agent-generator/framework-detector.ts +669 -0
  154. package/src/agent-generator/index.ts +634 -0
  155. package/src/agent-generator/stack-detector.ts +115 -0
  156. package/src/agent-generator/templates/core/agents.ts +1296 -0
  157. package/src/agent-generator/templates/core/architecture-rules.ts +287 -0
  158. package/src/agent-generator/templates/core/general-rules.ts +306 -0
  159. package/src/agent-generator/templates/core/hooks-generator.ts +242 -0
  160. package/src/agent-generator/templates/core/index-md.ts +260 -0
  161. package/src/agent-generator/templates/core/orchestrator.ts +459 -0
  162. package/src/agent-generator/templates/core/preflight.ts +215 -0
  163. package/src/agent-generator/templates/core/quality-gates.ts +256 -0
  164. package/src/agent-generator/templates/core/security-rules.ts +543 -0
  165. package/src/agent-generator/templates/core/skills-generator.ts +585 -0
  166. package/src/agent-generator/templates/core/workflow-fix-bug.ts +239 -0
  167. package/src/agent-generator/templates/core/workflow-new-feature.ts +323 -0
  168. package/src/agent-generator/templates/core/workflow-review.ts +106 -0
  169. package/src/agent-generator/templates/domain/index.ts +1201 -0
  170. package/src/agent-generator/templates/stack/index.ts +705 -0
  171. package/src/agent-generator/templates/template-helpers.ts +776 -0
  172. package/src/agent-generator/types.ts +232 -0
  173. package/src/analyzer.ts +51 -5
  174. package/src/analyzers/forecast.ts +496 -0
  175. package/src/analyzers/git-cache.ts +52 -0
  176. package/src/analyzers/git-history.ts +488 -0
  177. package/src/analyzers/index.ts +33 -0
  178. package/src/analyzers/temporal-scorer.ts +227 -0
  179. package/src/anti-patterns.ts +29 -6
  180. package/src/cli.ts +316 -117
  181. package/src/config.ts +52 -11
  182. package/src/html-reporter.ts +263 -13
  183. package/src/index.ts +93 -10
  184. package/src/project-summarizer.ts +521 -0
  185. package/src/refactor-reporter.ts +1 -1
  186. package/src/scanner.ts +136 -90
  187. package/src/scorer.ts +26 -11
  188. package/src/types.ts +27 -0
  189. package/tests/agent-generator.test.ts +427 -0
  190. package/tests/analyzers-integration.test.ts +174 -0
  191. package/tests/architect-adapter-enrichment.test.ts +9 -0
  192. package/tests/context-enricher.test.ts +971 -0
  193. package/tests/fixtures/monorepo/package.json +6 -0
  194. package/tests/fixtures/monorepo/packages/app/package.json +12 -0
  195. package/tests/fixtures/monorepo/packages/app/src/index.ts +6 -0
  196. package/tests/fixtures/monorepo/packages/core/package.json +7 -0
  197. package/tests/fixtures/monorepo/packages/core/src/index.ts +7 -0
  198. package/tests/forecast.test.ts +509 -0
  199. package/tests/framework-detector.test.ts +1172 -0
  200. package/tests/git-history.test.ts +254 -0
  201. package/tests/monorepo-scan.test.ts +170 -0
  202. package/tests/scanner.test.ts +7 -8
  203. package/tests/scorer.test.ts +594 -0
  204. package/tests/stack-detector.test.ts +241 -0
  205. package/tests/template-generation.test.ts +706 -0
  206. package/tests/template-helpers.test.ts +1152 -0
  207. package/tests/temporal-scorer.test.ts +307 -0
  208. package/dist/agent-generator.d.ts +0 -106
  209. package/dist/agent-generator.d.ts.map +0 -1
  210. package/dist/agent-generator.js +0 -1398
  211. package/dist/agent-generator.js.map +0 -1
  212. package/src/agent-generator.ts +0 -1526
@@ -0,0 +1,337 @@
1
+ /**
2
+ * Architecture Weather Forecast — Predictive analysis
3
+ *
4
+ * Combines temporal scores + velocity vectors + change coupling
5
+ * to predict which modules will become anti-patterns.
6
+ *
7
+ * Key concept: Pre-Anti-Pattern
8
+ * A module isn't an anti-pattern yet, but its trajectory says it will be.
9
+ * "Your code doesn't have a problem — it WILL have one in 3 months."
10
+ *
11
+ * @author Camilo Girardelli — Girardelli Tecnologia
12
+ * @license MIT
13
+ */
14
+ const DEFAULT_CONFIG = {
15
+ antiPatternThreshold: 40,
16
+ godClassChurnThreshold: 150,
17
+ shotgunCouplingThreshold: 5,
18
+ busFatorRiskThreshold: 1,
19
+ forecastWeeks: 26,
20
+ };
21
+ // ═══════════════════════════════════════════════════════════════
22
+ // FORECAST ENGINE
23
+ // ═══════════════════════════════════════════════════════════════
24
+ export class ForecastEngine {
25
+ constructor(config) {
26
+ this.config = { ...DEFAULT_CONFIG, ...config };
27
+ }
28
+ /**
29
+ * Generate architecture weather forecast.
30
+ */
31
+ forecast(gitReport, temporalReport) {
32
+ const preAntiPatterns = [];
33
+ const moduleForecastMap = new Map();
34
+ // Detect pre-anti-patterns for each module
35
+ for (const module of gitReport.modules) {
36
+ const temporal = temporalReport.modules.find(m => m.module === module.modulePath);
37
+ if (!temporal)
38
+ continue;
39
+ const patterns = this.detectPreAntiPatterns(module, temporal, gitReport.changeCouplings);
40
+ preAntiPatterns.push(...patterns);
41
+ const forecast = this.forecastModule(module, temporal, patterns);
42
+ moduleForecastMap.set(module.modulePath, forecast);
43
+ }
44
+ // Sort by risk
45
+ const modules = Array.from(moduleForecastMap.values())
46
+ .sort((a, b) => b.bottleneckProbability - a.bottleneckProbability);
47
+ const outlook = this.classifyOutlook(temporalReport, preAntiPatterns);
48
+ const headline = this.generateHeadline(outlook, preAntiPatterns, modules);
49
+ const topRisks = this.identifyTopRisks(modules, preAntiPatterns);
50
+ const recommendations = this.generateRecommendations(modules, preAntiPatterns);
51
+ return {
52
+ projectPath: gitReport.projectPath,
53
+ generatedAt: new Date().toISOString(),
54
+ overallOutlook: outlook,
55
+ headline,
56
+ modules,
57
+ preAntiPatterns: preAntiPatterns.sort((a, b) => a.weeksToThreshold - b.weeksToThreshold),
58
+ topRisks,
59
+ recommendations,
60
+ };
61
+ }
62
+ // ── Pre-Anti-Pattern Detection ──
63
+ detectPreAntiPatterns(module, temporal, couplings) {
64
+ const patterns = [];
65
+ patterns.push(...this.detectEmergingGodClass(module, temporal));
66
+ patterns.push(...this.detectEmergingShotgunSurgery(module, couplings));
67
+ patterns.push(...this.detectBusFactorRisk(module, temporal));
68
+ patterns.push(...this.detectComplexitySpiral(module, temporal));
69
+ patterns.push(...this.detectCouplingMagnet(module, couplings, temporal));
70
+ return patterns;
71
+ }
72
+ detectEmergingGodClass(module, temporal) {
73
+ const patterns = [];
74
+ for (const file of module.files) {
75
+ if (file.churnRate < this.config.godClassChurnThreshold)
76
+ continue;
77
+ if (temporal.velocity.churnTrend <= 0)
78
+ continue;
79
+ // Project when churn will exceed critical threshold
80
+ const weeklyGrowth = file.churnRate * (temporal.velocity.churnTrend / 100) / 4;
81
+ const criticalChurn = this.config.godClassChurnThreshold * 2;
82
+ const weeksToThreshold = weeklyGrowth > 0
83
+ ? Math.ceil((criticalChurn - file.churnRate) / weeklyGrowth)
84
+ : Infinity;
85
+ if (weeksToThreshold <= this.config.forecastWeeks) {
86
+ patterns.push({
87
+ type: 'emerging-god-class',
88
+ module: module.modulePath,
89
+ severity: weeksToThreshold <= 8 ? 'alert' : weeksToThreshold <= 16 ? 'warning' : 'watch',
90
+ currentScore: temporal.staticScore,
91
+ projectedScore: temporal.projectedScore,
92
+ weeksToThreshold,
93
+ threshold: criticalChurn,
94
+ description: `File '${file.path}' has churn rate ${Math.round(file.churnRate)} lines/commit and growing ${Math.round(temporal.velocity.churnTrend)}%`,
95
+ evidence: [
96
+ `Current churn: ${Math.round(file.churnRate)} lines/commit`,
97
+ `Growth rate: ${Math.round(temporal.velocity.churnTrend)}%`,
98
+ `${file.commits} commits in analysis period`,
99
+ `${file.authors.size} contributor(s)`,
100
+ ],
101
+ recommendation: 'Split into smaller, focused modules before complexity makes refactoring prohibitively expensive.',
102
+ confidence: Math.min(0.9, 0.5 + (file.commits / 50)),
103
+ });
104
+ }
105
+ }
106
+ return patterns;
107
+ }
108
+ detectEmergingShotgunSurgery(module, couplings) {
109
+ // Count how many files this module is coupled with
110
+ const moduleCouplings = couplings.filter(c => c.fileA.startsWith(module.modulePath) || c.fileB.startsWith(module.modulePath));
111
+ if (moduleCouplings.length < this.config.shotgunCouplingThreshold)
112
+ return [];
113
+ const avgConfidence = moduleCouplings.reduce((s, c) => s + c.confidence, 0) / moduleCouplings.length;
114
+ return [{
115
+ type: 'emerging-shotgun-surgery',
116
+ module: module.modulePath,
117
+ severity: moduleCouplings.length > 10 ? 'alert' : 'warning',
118
+ currentScore: 0,
119
+ projectedScore: 0,
120
+ weeksToThreshold: 4,
121
+ threshold: this.config.shotgunCouplingThreshold,
122
+ description: `Module '${module.modulePath}' has ${moduleCouplings.length} change-coupled files — changes here ripple across the codebase`,
123
+ evidence: [
124
+ `${moduleCouplings.length} files change together with this module`,
125
+ `Average coupling confidence: ${Math.round(avgConfidence * 100)}%`,
126
+ ...moduleCouplings.slice(0, 3).map(c => `${c.fileA} ↔ ${c.fileB} (${c.cochangeCount} co-changes)`),
127
+ ],
128
+ recommendation: 'Extract shared concerns into a dedicated module. Introduce interfaces to decouple.',
129
+ confidence: avgConfidence,
130
+ }];
131
+ }
132
+ detectBusFactorRisk(module, temporal) {
133
+ if (module.busFactor > this.config.busFatorRiskThreshold)
134
+ return [];
135
+ if (module.aggregateCommits < 5)
136
+ return []; // too few commits to judge
137
+ return [{
138
+ type: 'bus-factor-risk',
139
+ module: module.modulePath,
140
+ severity: temporal.trend === 'degrading' ? 'alert' : 'warning',
141
+ currentScore: temporal.staticScore,
142
+ projectedScore: temporal.projectedScore,
143
+ weeksToThreshold: this.config.forecastWeeks,
144
+ threshold: 2,
145
+ description: `Module '${module.modulePath}' has bus factor of ${module.busFactor} — all knowledge in one person`,
146
+ evidence: [
147
+ `Only ${module.busFactor} contributor(s)`,
148
+ `${module.aggregateCommits} total commits`,
149
+ `${module.files.length} files in module`,
150
+ ],
151
+ recommendation: 'Pair programming or code review rotation to spread knowledge. Document critical decisions.',
152
+ confidence: 0.8,
153
+ }];
154
+ }
155
+ detectComplexitySpiral(module, temporal) {
156
+ if (temporal.velocity.churnTrend <= 20)
157
+ return [];
158
+ if (temporal.velocity.direction !== 'accelerating')
159
+ return [];
160
+ // Accelerating churn + increasing commit rate = complexity spiral
161
+ const weeklyScoreDecay = (temporal.staticScore - temporal.projectedScore) / temporal.projectionWeeks;
162
+ const weeksToThreshold = weeklyScoreDecay > 0
163
+ ? Math.ceil((temporal.temporalScore - this.config.antiPatternThreshold) / weeklyScoreDecay)
164
+ : Infinity;
165
+ if (weeksToThreshold > this.config.forecastWeeks)
166
+ return [];
167
+ return [{
168
+ type: 'complexity-spiral',
169
+ module: module.modulePath,
170
+ severity: weeksToThreshold <= 8 ? 'alert' : 'warning',
171
+ currentScore: temporal.temporalScore,
172
+ projectedScore: temporal.projectedScore,
173
+ weeksToThreshold,
174
+ threshold: this.config.antiPatternThreshold,
175
+ description: `Module '${module.modulePath}' is in a complexity spiral — accelerating churn with increasing commit frequency`,
176
+ evidence: [
177
+ `Churn trend: +${Math.round(temporal.velocity.churnTrend)}%`,
178
+ `Commit acceleration: +${Math.round(temporal.velocity.commitAcceleration)}%`,
179
+ `Current temporal score: ${temporal.temporalScore}/100`,
180
+ `Projected score in ${temporal.projectionWeeks} weeks: ${temporal.projectedScore}/100`,
181
+ ],
182
+ recommendation: 'Stop adding features to this module. Invest in refactoring and test coverage first.',
183
+ confidence: temporal.projectionConfidence,
184
+ }];
185
+ }
186
+ detectCouplingMagnet(module, couplings, temporal) {
187
+ // Files that are increasingly coupled with many others
188
+ const inboundCouplings = couplings.filter(c => c.fileB.startsWith(module.modulePath) && c.confidence > 0.5);
189
+ if (inboundCouplings.length < 3)
190
+ return [];
191
+ if (temporal.velocity.commitAcceleration <= 0)
192
+ return [];
193
+ return [{
194
+ type: 'coupling-magnet',
195
+ module: module.modulePath,
196
+ severity: 'watch',
197
+ currentScore: temporal.staticScore,
198
+ projectedScore: temporal.projectedScore,
199
+ weeksToThreshold: 12,
200
+ threshold: 10,
201
+ description: `Module '${module.modulePath}' is becoming a coupling magnet — ${inboundCouplings.length} high-confidence inbound dependencies`,
202
+ evidence: [
203
+ `${inboundCouplings.length} modules depend on changes here`,
204
+ `Module commit rate accelerating: +${Math.round(temporal.velocity.commitAcceleration)}%`,
205
+ ],
206
+ recommendation: 'Extract stable interfaces. Consider the Dependency Inversion Principle to break inbound coupling.',
207
+ confidence: 0.6,
208
+ }];
209
+ }
210
+ // ── Module Forecast ──
211
+ forecastModule(module, temporal, patterns) {
212
+ const health = this.classifyHealth(temporal);
213
+ const forecast6m = this.classify6MonthForecast(temporal, patterns);
214
+ const bottleneckProb = this.calculateBottleneckProbability(temporal, patterns, module);
215
+ const riskFactors = [];
216
+ if (temporal.trend === 'degrading')
217
+ riskFactors.push('Score degrading');
218
+ if (module.busFactor <= 1)
219
+ riskFactors.push('Single contributor');
220
+ if (temporal.velocity.churnTrend > 30)
221
+ riskFactors.push('Churn increasing');
222
+ if (patterns.length > 0)
223
+ riskFactors.push(`${patterns.length} pre-anti-pattern(s)`);
224
+ const topAction = patterns.length > 0
225
+ ? patterns[0].recommendation
226
+ : temporal.trend === 'degrading'
227
+ ? 'Review recent changes and stabilize'
228
+ : 'No action needed';
229
+ return {
230
+ module: module.modulePath,
231
+ currentHealth: health,
232
+ forecast6Months: forecast6m,
233
+ preAntiPatterns: patterns,
234
+ bottleneckProbability: bottleneckProb,
235
+ riskFactors,
236
+ topAction,
237
+ };
238
+ }
239
+ classifyHealth(temporal) {
240
+ if (temporal.temporalScore < 30)
241
+ return 'critical';
242
+ if (temporal.temporalScore < 50 || temporal.trend === 'degrading')
243
+ return 'degrading';
244
+ if (temporal.temporalScore < 70)
245
+ return 'at-risk';
246
+ return 'healthy';
247
+ }
248
+ classify6MonthForecast(temporal, patterns) {
249
+ const alerts = patterns.filter(p => p.severity === 'alert');
250
+ if (alerts.length > 0 || temporal.projectedScore < 30)
251
+ return 'breakdown';
252
+ if (temporal.trend === 'degrading' || patterns.length > 0)
253
+ return 'declining';
254
+ return 'stable';
255
+ }
256
+ calculateBottleneckProbability(temporal, patterns, module) {
257
+ let prob = 0;
258
+ // Low score → higher probability
259
+ if (temporal.temporalScore < 50)
260
+ prob += 0.3;
261
+ else if (temporal.temporalScore < 70)
262
+ prob += 0.1;
263
+ // Degrading trend
264
+ if (temporal.trend === 'degrading')
265
+ prob += 0.2;
266
+ // Pre-anti-patterns
267
+ prob += Math.min(0.3, patterns.length * 0.1);
268
+ // Low bus factor
269
+ if (module.busFactor <= 1)
270
+ prob += 0.1;
271
+ // High churn
272
+ if (temporal.velocity.churnTrend > 30)
273
+ prob += 0.1;
274
+ return Math.min(1, Math.round(prob * 100) / 100);
275
+ }
276
+ // ── Overall Analysis ──
277
+ classifyOutlook(temporal, patterns) {
278
+ const alerts = patterns.filter(p => p.severity === 'alert');
279
+ if (alerts.length >= 2 || temporal.overallTrend === 'degrading')
280
+ return 'stormy';
281
+ if (alerts.length >= 1 || patterns.length >= 3)
282
+ return 'cloudy';
283
+ return 'sunny';
284
+ }
285
+ generateHeadline(outlook, patterns, modules) {
286
+ const critical = modules.filter(m => m.currentHealth === 'critical').length;
287
+ const degrading = modules.filter(m => m.currentHealth === 'degrading').length;
288
+ switch (outlook) {
289
+ case 'stormy':
290
+ return `${critical + degrading} module(s) at risk. ${patterns.length} pre-anti-pattern(s) detected. Immediate action recommended.`;
291
+ case 'cloudy':
292
+ return `Architecture trending stable with ${patterns.length} emerging concern(s). Proactive refactoring recommended.`;
293
+ case 'sunny':
294
+ return 'Architecture is healthy and stable. Continue current practices.';
295
+ }
296
+ }
297
+ identifyTopRisks(modules, patterns) {
298
+ const risks = [];
299
+ const breakdowns = modules.filter(m => m.forecast6Months === 'breakdown');
300
+ if (breakdowns.length > 0) {
301
+ risks.push(`${breakdowns.length} module(s) projected to break down within 6 months: ${breakdowns.map(m => m.module).join(', ')}`);
302
+ }
303
+ const busRisks = patterns.filter(p => p.type === 'bus-factor-risk');
304
+ if (busRisks.length > 0) {
305
+ risks.push(`Bus factor risk in ${busRisks.length} module(s) — knowledge concentrated in single contributors`);
306
+ }
307
+ const spirals = patterns.filter(p => p.type === 'complexity-spiral');
308
+ if (spirals.length > 0) {
309
+ risks.push(`Complexity spiral detected in: ${spirals.map(p => p.module).join(', ')}`);
310
+ }
311
+ return risks.slice(0, 5);
312
+ }
313
+ generateRecommendations(modules, patterns) {
314
+ const recs = [];
315
+ const critical = modules.filter(m => m.currentHealth === 'critical');
316
+ if (critical.length > 0) {
317
+ recs.push(`Immediate: Stabilize ${critical.map(m => m.module).join(', ')} — freeze features, invest in refactoring`);
318
+ }
319
+ const godClasses = patterns.filter(p => p.type === 'emerging-god-class');
320
+ if (godClasses.length > 0) {
321
+ recs.push(`Split growing files before they become god classes: ${godClasses.map(p => p.module).join(', ')}`);
322
+ }
323
+ const shotgun = patterns.filter(p => p.type === 'emerging-shotgun-surgery');
324
+ if (shotgun.length > 0) {
325
+ recs.push(`Decouple modules with high change coupling to prevent shotgun surgery`);
326
+ }
327
+ const busRisks = patterns.filter(p => p.type === 'bus-factor-risk');
328
+ if (busRisks.length > 0) {
329
+ recs.push(`Spread knowledge: pair programming or rotation for ${busRisks.map(p => p.module).join(', ')}`);
330
+ }
331
+ if (recs.length === 0) {
332
+ recs.push('Architecture is healthy. Continue monitoring temporal trends.');
333
+ }
334
+ return recs.slice(0, 5);
335
+ }
336
+ }
337
+ //# sourceMappingURL=forecast.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"forecast.js","sourceRoot":"","sources":["../../src/analyzers/forecast.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAwEH,MAAM,cAAc,GAA6B;IAC/C,oBAAoB,EAAE,EAAE;IACxB,sBAAsB,EAAE,GAAG;IAC3B,wBAAwB,EAAE,CAAC;IAC3B,qBAAqB,EAAE,CAAC;IACxB,aAAa,EAAE,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AAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACxB,IAAI,CAAC,IAAI,CAAC,sDAAsD,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC5G,CAAC;QAED,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACtB,IAAI,CAAC,IAAI,CAAC,+DAA+D,CAAC,CAAC;QAC7E,CAAC;QAED,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC1B,CAAC;CACF"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Git History Cache — Serialize/deserialize GitHistoryReport
3
+ */
4
+ import type { GitHistoryReport } from './git-history.js';
5
+ export declare function saveToCache(report: GitHistoryReport, projectPath: string, cacheDir?: string): void;
6
+ export declare function loadFromCache(projectPath: string, cacheDir?: string, maxAgeMs?: number): GitHistoryReport | null;
7
+ //# sourceMappingURL=git-cache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"git-cache.d.ts","sourceRoot":"","sources":["../../src/analyzers/git-cache.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEzD,wBAAgB,WAAW,CACzB,MAAM,EAAE,gBAAgB,EACxB,WAAW,EAAE,MAAM,EACnB,QAAQ,SAAqB,GAC5B,IAAI,CAsBN;AAED,wBAAgB,aAAa,CAC3B,WAAW,EAAE,MAAM,EACnB,QAAQ,SAAqB,EAC7B,QAAQ,SAAU,GACjB,gBAAgB,GAAG,IAAI,CAWzB"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Git History Cache — Serialize/deserialize GitHistoryReport
3
+ */
4
+ import * as fs from 'fs';
5
+ import * as path from 'path';
6
+ export function saveToCache(report, projectPath, cacheDir = '.architect-cache') {
7
+ const dir = path.join(projectPath, cacheDir);
8
+ fs.mkdirSync(dir, { recursive: true });
9
+ const serializable = {
10
+ ...report,
11
+ modules: report.modules.map(m => ({
12
+ ...m,
13
+ files: m.files.map(f => ({
14
+ ...f,
15
+ authors: Array.from(f.authors),
16
+ lastModified: f.lastModified.toISOString(),
17
+ })),
18
+ })),
19
+ hotspots: report.hotspots.map(f => ({
20
+ ...f,
21
+ authors: Array.from(f.authors),
22
+ lastModified: f.lastModified.toISOString(),
23
+ })),
24
+ };
25
+ fs.writeFileSync(path.join(dir, 'git-history.json'), JSON.stringify(serializable, null, 2));
26
+ }
27
+ export function loadFromCache(projectPath, cacheDir = '.architect-cache', maxAgeMs = 3600000) {
28
+ const cachePath = path.join(projectPath, cacheDir, 'git-history.json');
29
+ if (!fs.existsSync(cachePath))
30
+ return null;
31
+ try {
32
+ const raw = JSON.parse(fs.readFileSync(cachePath, 'utf-8'));
33
+ if (Date.now() - new Date(raw.analyzedAt).getTime() > maxAgeMs)
34
+ return null;
35
+ return raw;
36
+ }
37
+ catch {
38
+ return null;
39
+ }
40
+ }
41
+ //# sourceMappingURL=git-cache.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"git-cache.js","sourceRoot":"","sources":["../../src/analyzers/git-cache.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAG7B,MAAM,UAAU,WAAW,CACzB,MAAwB,EACxB,WAAmB,EACnB,QAAQ,GAAG,kBAAkB;IAE7B,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;IAC7C,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAEvC,MAAM,YAAY,GAAG;QACnB,GAAG,MAAM;QACT,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,GAAG,CAA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AAE,GAAG,QAAQ;YAAE,OAAO,IAAI,CAAC;QAC5E,OAAO,GAAG,CAAC;IACb,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
@@ -0,0 +1,113 @@
1
+ /**
2
+ * Git History Analyzer — Temporal analysis of codebase evolution
3
+ *
4
+ * Reads git log to build velocity vectors, churn rates, and hotspot maps.
5
+ * Enables Architect v4's predictive capabilities.
6
+ *
7
+ * Key metrics per module:
8
+ * - Commit frequency (commits/week rolling 4-week average)
9
+ * - Churn rate (lines added + deleted per commit)
10
+ * - Author diversity (bus factor proxy)
11
+ * - Change coupling (files that change together)
12
+ *
13
+ * @author Camilo Girardelli — Girardelli Tecnologia
14
+ * @license MIT
15
+ */
16
+ export interface GitCommit {
17
+ hash: string;
18
+ author: string;
19
+ date: Date;
20
+ message: string;
21
+ files: FileChange[];
22
+ }
23
+ export interface FileChange {
24
+ path: string;
25
+ additions: number;
26
+ deletions: number;
27
+ }
28
+ export interface FileHistory {
29
+ path: string;
30
+ commits: number;
31
+ totalAdditions: number;
32
+ totalDeletions: number;
33
+ churnRate: number;
34
+ authors: Set<string>;
35
+ busFactor: number;
36
+ lastModified: Date;
37
+ weeklyCommitRate: number;
38
+ isHotspot: boolean;
39
+ }
40
+ export interface ModuleHistory {
41
+ modulePath: string;
42
+ files: FileHistory[];
43
+ aggregateCommits: number;
44
+ aggregateChurn: number;
45
+ avgWeeklyRate: number;
46
+ topHotspots: FileHistory[];
47
+ velocityVector: VelocityVector;
48
+ busFactor: number;
49
+ }
50
+ export interface VelocityVector {
51
+ /** Commit rate trend: positive = accelerating, negative = decelerating */
52
+ commitAcceleration: number;
53
+ /** Churn trend: positive = increasing complexity, negative = stabilizing */
54
+ churnTrend: number;
55
+ /** Overall direction: "accelerating" | "stable" | "decelerating" */
56
+ direction: 'accelerating' | 'stable' | 'decelerating';
57
+ }
58
+ export interface ChangeCoupling {
59
+ fileA: string;
60
+ fileB: string;
61
+ cochangeCount: number;
62
+ confidence: number;
63
+ }
64
+ export interface GitHistoryReport {
65
+ projectPath: string;
66
+ analyzedAt: string;
67
+ periodWeeks: number;
68
+ totalCommits: number;
69
+ totalAuthors: number;
70
+ modules: ModuleHistory[];
71
+ hotspots: FileHistory[];
72
+ changeCouplings: ChangeCoupling[];
73
+ commitTimeline: WeeklySnapshot[];
74
+ }
75
+ export interface WeeklySnapshot {
76
+ weekStart: string;
77
+ commits: number;
78
+ churn: number;
79
+ activeFiles: number;
80
+ }
81
+ export interface GitAnalyzerConfig {
82
+ /** How many weeks of history to analyze (default: 24) */
83
+ periodWeeks?: number;
84
+ /** Rolling window for averages (default: 4 weeks) */
85
+ rollingWindowWeeks?: number;
86
+ /** Churn threshold to flag as hotspot (default: 500 lines) */
87
+ hotspotChurnThreshold?: number;
88
+ /** Minimum co-change count for coupling (default: 3) */
89
+ couplingMinCochanges?: number;
90
+ /** Path to cache dir (default: .architect-cache/) */
91
+ cacheDir?: string;
92
+ }
93
+ export declare class GitHistoryAnalyzer {
94
+ private config;
95
+ constructor(config?: GitAnalyzerConfig);
96
+ /**
97
+ * Analyze git history for the project at the given path.
98
+ * Returns a comprehensive GitHistoryReport.
99
+ */
100
+ analyze(projectPath: string): GitHistoryReport;
101
+ private parseGitLog;
102
+ private parseLogOutput;
103
+ private buildFileHistories;
104
+ private groupByModule;
105
+ private calculateVelocity;
106
+ private detectHotspots;
107
+ private detectChangeCoupling;
108
+ private buildTimeline;
109
+ private validateGitRepo;
110
+ private getSinceDate;
111
+ private getModulePath;
112
+ }
113
+ //# sourceMappingURL=git-history.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"git-history.d.ts","sourceRoot":"","sources":["../../src/analyzers/git-history.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAUH,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,IAAI,CAAC;IACX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