@girardelli/architect 5.0.0 → 8.1.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 (335) hide show
  1. package/dist/{cli.d.ts → src/adapters/cli.d.ts} +1 -2
  2. package/dist/{cli.js → src/adapters/cli.js} +191 -213
  3. package/dist/src/adapters/cli.js.map +1 -0
  4. package/dist/src/adapters/github-action.d.ts +9 -0
  5. package/dist/src/adapters/github-action.js +94 -0
  6. package/dist/src/adapters/github-action.js.map +1 -0
  7. package/dist/src/adapters/html-reporter/scripts.d.ts +5 -0
  8. package/dist/src/adapters/html-reporter/scripts.js +400 -0
  9. package/dist/src/adapters/html-reporter/scripts.js.map +1 -0
  10. package/dist/src/adapters/html-reporter/sections/agents.d.ts +2 -0
  11. package/dist/src/adapters/html-reporter/sections/agents.js +260 -0
  12. package/dist/src/adapters/html-reporter/sections/agents.js.map +1 -0
  13. package/dist/src/adapters/html-reporter/sections/anti-patterns.d.ts +13 -0
  14. package/dist/src/adapters/html-reporter/sections/anti-patterns.js +64 -0
  15. package/dist/src/adapters/html-reporter/sections/anti-patterns.js.map +1 -0
  16. package/dist/src/adapters/html-reporter/sections/header.d.ts +3 -0
  17. package/dist/src/adapters/html-reporter/sections/header.js +30 -0
  18. package/dist/src/adapters/html-reporter/sections/header.js.map +1 -0
  19. package/dist/src/adapters/html-reporter/sections/layers.d.ts +9 -0
  20. package/dist/src/adapters/html-reporter/sections/layers.js +143 -0
  21. package/dist/src/adapters/html-reporter/sections/layers.js.map +1 -0
  22. package/dist/src/adapters/html-reporter/sections/overview.d.ts +2 -0
  23. package/dist/src/adapters/html-reporter/sections/overview.js +58 -0
  24. package/dist/src/adapters/html-reporter/sections/overview.js.map +1 -0
  25. package/dist/src/adapters/html-reporter/sections/refactoring-plan.d.ts +3 -0
  26. package/dist/src/adapters/html-reporter/sections/refactoring-plan.js +151 -0
  27. package/dist/src/adapters/html-reporter/sections/refactoring-plan.js.map +1 -0
  28. package/dist/src/adapters/html-reporter/sections/score.d.ts +7 -0
  29. package/dist/src/adapters/html-reporter/sections/score.js +70 -0
  30. package/dist/src/adapters/html-reporter/sections/score.js.map +1 -0
  31. package/dist/src/adapters/html-reporter/sections/suggestions.d.ts +7 -0
  32. package/dist/src/adapters/html-reporter/sections/suggestions.js +34 -0
  33. package/dist/src/adapters/html-reporter/sections/suggestions.js.map +1 -0
  34. package/dist/src/adapters/html-reporter/styles.d.ts +1 -0
  35. package/dist/src/adapters/html-reporter/styles.js +526 -0
  36. package/dist/src/adapters/html-reporter/styles.js.map +1 -0
  37. package/dist/src/adapters/html-reporter/utils_adapters.d.ts +20 -0
  38. package/dist/src/adapters/html-reporter/utils_adapters.js +32 -0
  39. package/dist/src/adapters/html-reporter/utils_adapters.js.map +1 -0
  40. package/dist/src/adapters/html-reporter/utils_sections.d.ts +7 -0
  41. package/dist/src/adapters/html-reporter/utils_sections.js +58 -0
  42. package/dist/src/adapters/html-reporter/utils_sections.js.map +1 -0
  43. package/dist/src/adapters/html-reporter.d.ts +10 -0
  44. package/dist/src/adapters/html-reporter.js +97 -0
  45. package/dist/src/adapters/html-reporter.js.map +1 -0
  46. package/dist/src/adapters/progress-logger.d.ts +55 -0
  47. package/dist/src/adapters/progress-logger.js +200 -0
  48. package/dist/src/adapters/progress-logger.js.map +1 -0
  49. package/dist/{refactor-reporter.d.ts → src/adapters/refactor-reporter.d.ts} +1 -2
  50. package/dist/{refactor-reporter.js → src/adapters/refactor-reporter.js} +1 -1
  51. package/dist/src/adapters/refactor-reporter.js.map +1 -0
  52. package/dist/{reporter.d.ts → src/adapters/reporter.d.ts} +1 -2
  53. package/dist/src/adapters/reporter.js.map +1 -0
  54. package/dist/src/core/GenesisTerminal.d.ts +8 -0
  55. package/dist/src/core/GenesisTerminal.js +105 -0
  56. package/dist/src/core/GenesisTerminal.js.map +1 -0
  57. package/dist/{index.d.ts → src/core/architect.d.ts} +4 -18
  58. package/dist/{index.js → src/core/architect.js} +22 -21
  59. package/dist/src/core/architect.js.map +1 -0
  60. package/dist/tests/architect-adapter-enrichment.test.d.ts +1 -0
  61. package/dist/tests/architect-adapter-enrichment.test.js +11 -0
  62. package/dist/tests/architect-adapter-enrichment.test.js.map +1 -0
  63. package/dist/tests/github-action.test.d.ts +1 -0
  64. package/dist/tests/github-action.test.js +92 -0
  65. package/dist/tests/github-action.test.js.map +1 -0
  66. package/package.json +15 -65
  67. package/src/adapters/cli.ts +492 -0
  68. package/src/adapters/github-action.ts +109 -0
  69. package/src/adapters/html-reporter/scripts.ts +402 -0
  70. package/src/adapters/html-reporter/sections/agents.ts +267 -0
  71. package/src/adapters/html-reporter/sections/anti-patterns.ts +81 -0
  72. package/src/adapters/html-reporter/sections/header.ts +35 -0
  73. package/src/adapters/html-reporter/sections/layers.ts +165 -0
  74. package/src/adapters/html-reporter/sections/overview.ts +64 -0
  75. package/src/adapters/html-reporter/sections/refactoring-plan.ts +166 -0
  76. package/src/adapters/html-reporter/sections/score.ts +80 -0
  77. package/src/adapters/html-reporter/sections/suggestions.ts +39 -0
  78. package/src/adapters/html-reporter/styles.ts +525 -0
  79. package/src/adapters/html-reporter/utils_adapters.ts +39 -0
  80. package/src/adapters/html-reporter/utils_sections.ts +55 -0
  81. package/src/adapters/html-reporter.ts +102 -0
  82. package/src/adapters/progress-logger.ts +236 -0
  83. package/src/{refactor-reporter.ts → adapters/refactor-reporter.ts} +2 -2
  84. package/src/{reporter.ts → adapters/reporter.ts} +1 -1
  85. package/src/core/GenesisTerminal.ts +127 -0
  86. package/src/{index.ts → core/architect.ts} +27 -45
  87. package/tests/github-action.test.ts +109 -0
  88. package/tsconfig.json +12 -19
  89. package/CONTRIBUTING.md +0 -140
  90. package/LICENSE +0 -21
  91. package/PROJECT_STRUCTURE.txt +0 -168
  92. package/README.md +0 -257
  93. package/architect-run.sh +0 -431
  94. package/assets/banner-v3.html +0 -561
  95. package/dist/agent-generator/context-enricher.d.ts +0 -58
  96. package/dist/agent-generator/context-enricher.d.ts.map +0 -1
  97. package/dist/agent-generator/context-enricher.js +0 -613
  98. package/dist/agent-generator/context-enricher.js.map +0 -1
  99. package/dist/agent-generator/domain-inferrer.d.ts +0 -52
  100. package/dist/agent-generator/domain-inferrer.d.ts.map +0 -1
  101. package/dist/agent-generator/domain-inferrer.js +0 -585
  102. package/dist/agent-generator/domain-inferrer.js.map +0 -1
  103. package/dist/agent-generator/framework-detector.d.ts +0 -40
  104. package/dist/agent-generator/framework-detector.d.ts.map +0 -1
  105. package/dist/agent-generator/framework-detector.js +0 -611
  106. package/dist/agent-generator/framework-detector.js.map +0 -1
  107. package/dist/agent-generator/index.d.ts +0 -47
  108. package/dist/agent-generator/index.d.ts.map +0 -1
  109. package/dist/agent-generator/index.js +0 -545
  110. package/dist/agent-generator/index.js.map +0 -1
  111. package/dist/agent-generator/stack-detector.d.ts +0 -14
  112. package/dist/agent-generator/stack-detector.d.ts.map +0 -1
  113. package/dist/agent-generator/stack-detector.js +0 -124
  114. package/dist/agent-generator/stack-detector.js.map +0 -1
  115. package/dist/agent-generator/templates/core/agents.d.ts +0 -17
  116. package/dist/agent-generator/templates/core/agents.d.ts.map +0 -1
  117. package/dist/agent-generator/templates/core/agents.js +0 -1256
  118. package/dist/agent-generator/templates/core/agents.js.map +0 -1
  119. package/dist/agent-generator/templates/core/architecture-rules.d.ts +0 -7
  120. package/dist/agent-generator/templates/core/architecture-rules.d.ts.map +0 -1
  121. package/dist/agent-generator/templates/core/architecture-rules.js +0 -274
  122. package/dist/agent-generator/templates/core/architecture-rules.js.map +0 -1
  123. package/dist/agent-generator/templates/core/general-rules.d.ts +0 -8
  124. package/dist/agent-generator/templates/core/general-rules.d.ts.map +0 -1
  125. package/dist/agent-generator/templates/core/general-rules.js +0 -301
  126. package/dist/agent-generator/templates/core/general-rules.js.map +0 -1
  127. package/dist/agent-generator/templates/core/hooks-generator.d.ts +0 -21
  128. package/dist/agent-generator/templates/core/hooks-generator.d.ts.map +0 -1
  129. package/dist/agent-generator/templates/core/hooks-generator.js +0 -233
  130. package/dist/agent-generator/templates/core/hooks-generator.js.map +0 -1
  131. package/dist/agent-generator/templates/core/index-md.d.ts +0 -7
  132. package/dist/agent-generator/templates/core/index-md.d.ts.map +0 -1
  133. package/dist/agent-generator/templates/core/index-md.js +0 -246
  134. package/dist/agent-generator/templates/core/index-md.js.map +0 -1
  135. package/dist/agent-generator/templates/core/orchestrator.d.ts +0 -8
  136. package/dist/agent-generator/templates/core/orchestrator.d.ts.map +0 -1
  137. package/dist/agent-generator/templates/core/orchestrator.js +0 -422
  138. package/dist/agent-generator/templates/core/orchestrator.js.map +0 -1
  139. package/dist/agent-generator/templates/core/preflight.d.ts +0 -8
  140. package/dist/agent-generator/templates/core/preflight.d.ts.map +0 -1
  141. package/dist/agent-generator/templates/core/preflight.js +0 -213
  142. package/dist/agent-generator/templates/core/preflight.js.map +0 -1
  143. package/dist/agent-generator/templates/core/quality-gates.d.ts +0 -11
  144. package/dist/agent-generator/templates/core/quality-gates.d.ts.map +0 -1
  145. package/dist/agent-generator/templates/core/quality-gates.js +0 -254
  146. package/dist/agent-generator/templates/core/quality-gates.js.map +0 -1
  147. package/dist/agent-generator/templates/core/security-rules.d.ts +0 -7
  148. package/dist/agent-generator/templates/core/security-rules.d.ts.map +0 -1
  149. package/dist/agent-generator/templates/core/security-rules.js +0 -528
  150. package/dist/agent-generator/templates/core/security-rules.js.map +0 -1
  151. package/dist/agent-generator/templates/core/skills-generator.d.ts +0 -19
  152. package/dist/agent-generator/templates/core/skills-generator.d.ts.map +0 -1
  153. package/dist/agent-generator/templates/core/skills-generator.js +0 -546
  154. package/dist/agent-generator/templates/core/skills-generator.js.map +0 -1
  155. package/dist/agent-generator/templates/core/workflow-fix-bug.d.ts +0 -7
  156. package/dist/agent-generator/templates/core/workflow-fix-bug.d.ts.map +0 -1
  157. package/dist/agent-generator/templates/core/workflow-fix-bug.js +0 -237
  158. package/dist/agent-generator/templates/core/workflow-fix-bug.js.map +0 -1
  159. package/dist/agent-generator/templates/core/workflow-new-feature.d.ts +0 -8
  160. package/dist/agent-generator/templates/core/workflow-new-feature.d.ts.map +0 -1
  161. package/dist/agent-generator/templates/core/workflow-new-feature.js +0 -321
  162. package/dist/agent-generator/templates/core/workflow-new-feature.js.map +0 -1
  163. package/dist/agent-generator/templates/core/workflow-review.d.ts +0 -7
  164. package/dist/agent-generator/templates/core/workflow-review.d.ts.map +0 -1
  165. package/dist/agent-generator/templates/core/workflow-review.js +0 -104
  166. package/dist/agent-generator/templates/core/workflow-review.js.map +0 -1
  167. package/dist/agent-generator/templates/domain/index.d.ts +0 -22
  168. package/dist/agent-generator/templates/domain/index.d.ts.map +0 -1
  169. package/dist/agent-generator/templates/domain/index.js +0 -1176
  170. package/dist/agent-generator/templates/domain/index.js.map +0 -1
  171. package/dist/agent-generator/templates/stack/index.d.ts +0 -8
  172. package/dist/agent-generator/templates/stack/index.d.ts.map +0 -1
  173. package/dist/agent-generator/templates/stack/index.js +0 -695
  174. package/dist/agent-generator/templates/stack/index.js.map +0 -1
  175. package/dist/agent-generator/templates/template-helpers.d.ts +0 -75
  176. package/dist/agent-generator/templates/template-helpers.d.ts.map +0 -1
  177. package/dist/agent-generator/templates/template-helpers.js +0 -726
  178. package/dist/agent-generator/templates/template-helpers.js.map +0 -1
  179. package/dist/agent-generator/types.d.ts +0 -196
  180. package/dist/agent-generator/types.d.ts.map +0 -1
  181. package/dist/agent-generator/types.js +0 -27
  182. package/dist/agent-generator/types.js.map +0 -1
  183. package/dist/analyzer.d.ts +0 -38
  184. package/dist/analyzer.d.ts.map +0 -1
  185. package/dist/analyzer.js +0 -383
  186. package/dist/analyzer.js.map +0 -1
  187. package/dist/analyzers/forecast.d.ts +0 -85
  188. package/dist/analyzers/forecast.d.ts.map +0 -1
  189. package/dist/analyzers/forecast.js +0 -337
  190. package/dist/analyzers/forecast.js.map +0 -1
  191. package/dist/analyzers/git-cache.d.ts +0 -7
  192. package/dist/analyzers/git-cache.d.ts.map +0 -1
  193. package/dist/analyzers/git-cache.js +0 -41
  194. package/dist/analyzers/git-cache.js.map +0 -1
  195. package/dist/analyzers/git-history.d.ts +0 -113
  196. package/dist/analyzers/git-history.d.ts.map +0 -1
  197. package/dist/analyzers/git-history.js +0 -333
  198. package/dist/analyzers/git-history.js.map +0 -1
  199. package/dist/analyzers/index.d.ts +0 -10
  200. package/dist/analyzers/index.d.ts.map +0 -1
  201. package/dist/analyzers/index.js +0 -7
  202. package/dist/analyzers/index.js.map +0 -1
  203. package/dist/analyzers/temporal-scorer.d.ts +0 -72
  204. package/dist/analyzers/temporal-scorer.d.ts.map +0 -1
  205. package/dist/analyzers/temporal-scorer.js +0 -140
  206. package/dist/analyzers/temporal-scorer.js.map +0 -1
  207. package/dist/anti-patterns.d.ts +0 -24
  208. package/dist/anti-patterns.d.ts.map +0 -1
  209. package/dist/anti-patterns.js +0 -230
  210. package/dist/anti-patterns.js.map +0 -1
  211. package/dist/cli.d.ts.map +0 -1
  212. package/dist/cli.js.map +0 -1
  213. package/dist/config.d.ts +0 -12
  214. package/dist/config.d.ts.map +0 -1
  215. package/dist/config.js +0 -110
  216. package/dist/config.js.map +0 -1
  217. package/dist/diagram.d.ts +0 -9
  218. package/dist/diagram.d.ts.map +0 -1
  219. package/dist/diagram.js +0 -116
  220. package/dist/diagram.js.map +0 -1
  221. package/dist/html-reporter.d.ts +0 -47
  222. package/dist/html-reporter.d.ts.map +0 -1
  223. package/dist/html-reporter.js +0 -1747
  224. package/dist/html-reporter.js.map +0 -1
  225. package/dist/index.d.ts.map +0 -1
  226. package/dist/index.js.map +0 -1
  227. package/dist/project-summarizer.d.ts +0 -38
  228. package/dist/project-summarizer.d.ts.map +0 -1
  229. package/dist/project-summarizer.js +0 -463
  230. package/dist/project-summarizer.js.map +0 -1
  231. package/dist/refactor-engine.d.ts +0 -18
  232. package/dist/refactor-engine.d.ts.map +0 -1
  233. package/dist/refactor-engine.js +0 -86
  234. package/dist/refactor-engine.js.map +0 -1
  235. package/dist/refactor-reporter.d.ts.map +0 -1
  236. package/dist/refactor-reporter.js.map +0 -1
  237. package/dist/reporter.d.ts.map +0 -1
  238. package/dist/reporter.js.map +0 -1
  239. package/dist/rules/barrel-optimizer.d.ts +0 -13
  240. package/dist/rules/barrel-optimizer.d.ts.map +0 -1
  241. package/dist/rules/barrel-optimizer.js +0 -77
  242. package/dist/rules/barrel-optimizer.js.map +0 -1
  243. package/dist/rules/dead-code-detector.d.ts +0 -21
  244. package/dist/rules/dead-code-detector.d.ts.map +0 -1
  245. package/dist/rules/dead-code-detector.js +0 -117
  246. package/dist/rules/dead-code-detector.js.map +0 -1
  247. package/dist/rules/hub-splitter.d.ts +0 -13
  248. package/dist/rules/hub-splitter.d.ts.map +0 -1
  249. package/dist/rules/hub-splitter.js +0 -110
  250. package/dist/rules/hub-splitter.js.map +0 -1
  251. package/dist/rules/import-organizer.d.ts +0 -13
  252. package/dist/rules/import-organizer.d.ts.map +0 -1
  253. package/dist/rules/import-organizer.js +0 -85
  254. package/dist/rules/import-organizer.js.map +0 -1
  255. package/dist/rules/module-grouper.d.ts +0 -13
  256. package/dist/rules/module-grouper.d.ts.map +0 -1
  257. package/dist/rules/module-grouper.js +0 -110
  258. package/dist/rules/module-grouper.js.map +0 -1
  259. package/dist/scanner.d.ts +0 -31
  260. package/dist/scanner.d.ts.map +0 -1
  261. package/dist/scanner.js +0 -328
  262. package/dist/scanner.js.map +0 -1
  263. package/dist/scorer.d.ts +0 -27
  264. package/dist/scorer.d.ts.map +0 -1
  265. package/dist/scorer.js +0 -229
  266. package/dist/scorer.js.map +0 -1
  267. package/dist/types.d.ts +0 -186
  268. package/dist/types.d.ts.map +0 -1
  269. package/dist/types.js +0 -2
  270. package/dist/types.js.map +0 -1
  271. package/examples/sample-report.md +0 -207
  272. package/jest.config.js +0 -18
  273. package/src/agent-generator/context-enricher.ts +0 -672
  274. package/src/agent-generator/domain-inferrer.ts +0 -635
  275. package/src/agent-generator/framework-detector.ts +0 -669
  276. package/src/agent-generator/index.ts +0 -634
  277. package/src/agent-generator/stack-detector.ts +0 -115
  278. package/src/agent-generator/templates/core/agents.ts +0 -1296
  279. package/src/agent-generator/templates/core/architecture-rules.ts +0 -287
  280. package/src/agent-generator/templates/core/general-rules.ts +0 -306
  281. package/src/agent-generator/templates/core/hooks-generator.ts +0 -242
  282. package/src/agent-generator/templates/core/index-md.ts +0 -260
  283. package/src/agent-generator/templates/core/orchestrator.ts +0 -459
  284. package/src/agent-generator/templates/core/preflight.ts +0 -215
  285. package/src/agent-generator/templates/core/quality-gates.ts +0 -256
  286. package/src/agent-generator/templates/core/security-rules.ts +0 -543
  287. package/src/agent-generator/templates/core/skills-generator.ts +0 -585
  288. package/src/agent-generator/templates/core/workflow-fix-bug.ts +0 -239
  289. package/src/agent-generator/templates/core/workflow-new-feature.ts +0 -323
  290. package/src/agent-generator/templates/core/workflow-review.ts +0 -106
  291. package/src/agent-generator/templates/domain/index.ts +0 -1201
  292. package/src/agent-generator/templates/stack/index.ts +0 -705
  293. package/src/agent-generator/templates/template-helpers.ts +0 -776
  294. package/src/agent-generator/types.ts +0 -232
  295. package/src/analyzer.ts +0 -447
  296. package/src/analyzers/forecast.ts +0 -496
  297. package/src/analyzers/git-cache.ts +0 -52
  298. package/src/analyzers/git-history.ts +0 -488
  299. package/src/analyzers/index.ts +0 -33
  300. package/src/analyzers/temporal-scorer.ts +0 -227
  301. package/src/anti-patterns.ts +0 -287
  302. package/src/cli.ts +0 -517
  303. package/src/config.ts +0 -123
  304. package/src/diagram.ts +0 -144
  305. package/src/html-reporter.ts +0 -1830
  306. package/src/project-summarizer.ts +0 -521
  307. package/src/refactor-engine.ts +0 -117
  308. package/src/rules/barrel-optimizer.ts +0 -97
  309. package/src/rules/dead-code-detector.ts +0 -132
  310. package/src/rules/hub-splitter.ts +0 -123
  311. package/src/rules/import-organizer.ts +0 -98
  312. package/src/rules/module-grouper.ts +0 -124
  313. package/src/scanner.ts +0 -344
  314. package/src/scorer.ts +0 -254
  315. package/src/types.ts +0 -193
  316. package/tests/agent-generator.test.ts +0 -427
  317. package/tests/analyzers-integration.test.ts +0 -174
  318. package/tests/anti-patterns.test.ts +0 -94
  319. package/tests/context-enricher.test.ts +0 -971
  320. package/tests/fixtures/monorepo/package.json +0 -6
  321. package/tests/fixtures/monorepo/packages/app/package.json +0 -12
  322. package/tests/fixtures/monorepo/packages/app/src/index.ts +0 -6
  323. package/tests/fixtures/monorepo/packages/core/package.json +0 -7
  324. package/tests/fixtures/monorepo/packages/core/src/index.ts +0 -7
  325. package/tests/forecast.test.ts +0 -509
  326. package/tests/framework-detector.test.ts +0 -1172
  327. package/tests/git-history.test.ts +0 -254
  328. package/tests/monorepo-scan.test.ts +0 -170
  329. package/tests/scanner.test.ts +0 -54
  330. package/tests/scorer.test.ts +0 -674
  331. package/tests/stack-detector.test.ts +0 -241
  332. package/tests/template-generation.test.ts +0 -706
  333. package/tests/template-helpers.test.ts +0 -1152
  334. package/tests/temporal-scorer.test.ts +0 -307
  335. /package/dist/{reporter.js → src/adapters/reporter.js} +0 -0
@@ -1,337 +0,0 @@
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
@@ -1 +0,0 @@
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,EAAE;CAClB,CAAC;AAEF,kEAAkE;AAClE,kBAAkB;AAClB,kEAAkE;AAElE,MAAM,OAAO,cAAc;IAGzB,YAAY,MAAuB;QACjC,IAAI,CAAC,MAAM,GAAG,EAAE,GAAG,cAAc,EAAE,GAAG,MAAM,EAAE,CAAC;IACjD,CAAC;IAED;;OAEG;IACH,QAAQ,CACN,SAA2B,EAC3B,cAA8B;QAE9B,MAAM,eAAe,GAAqB,EAAE,CAAC;QAC7C,MAAM,iBAAiB,GAAG,IAAI,GAAG,EAA0B,CAAC;QAE5D,2CAA2C;QAC3C,KAAK,MAAM,MAAM,IAAI,SAAS,CAAC,OAAO,EAAE,CAAC;YACvC,MAAM,QAAQ,GAAG,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,UAAU,CAAC,CAAC;YAClF,IAAI,CAAC,QAAQ;gBAAE,SAAS;YAExB,MAAM,QAAQ,GAAG,IAAI,CAAC,qBAAqB,CAAC,MAAM,EAAE,QAAQ,EAAE,SAAS,CAAC,eAAe,CAAC,CAAC;YACzF,eAAe,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,CAAC;YAElC,MAAM,QAAQ,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;YACjE,i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C;QAC/G,CAAC;QAED,MAAM,OAAO,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,0BAA0B,CAAC,CAAC;QAC5E,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACvB,IAAI,CAAC,IAAI,CAAC,uEAAuE,CAAC,CAAC;QACrF,CAAC;QAED,MAAM,QAAQ,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,iBAAiB,CAAC,CAAC;QACpE,IAAI,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"}
@@ -1,7 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,41 +0,0 @@
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
@@ -1 +0,0 @@
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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CAAC,CAAC;IACvE,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC;QAAE,OAAO,IAAI,CAAC;IAE3C,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC;QAC5D,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,OAAO,EAAE,GAAG,QAAQ;YAAE,OAAO,IAAI,CAAC;QAC5E,OAAO,GAAG,CAAC;IACb,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
@@ -1,113 +0,0 @@
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
@@ -1 +0,0 @@
1
- {"version":3,"file":"git-history.d.ts","sourceRoot":"","sources":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