@bugsbunnycodes1998/cartographer-core 0.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 (220) hide show
  1. package/dist/__tests__/pipeline.test.d.ts +2 -0
  2. package/dist/__tests__/pipeline.test.d.ts.map +1 -0
  3. package/dist/__tests__/pipeline.test.js +58 -0
  4. package/dist/__tests__/pipeline.test.js.map +1 -0
  5. package/dist/analysis/call-graph.d.ts +13 -0
  6. package/dist/analysis/call-graph.d.ts.map +1 -0
  7. package/dist/analysis/call-graph.js +133 -0
  8. package/dist/analysis/call-graph.js.map +1 -0
  9. package/dist/analysis/dependency-graph.d.ts +8 -0
  10. package/dist/analysis/dependency-graph.d.ts.map +1 -0
  11. package/dist/analysis/dependency-graph.js +101 -0
  12. package/dist/analysis/dependency-graph.js.map +1 -0
  13. package/dist/analysis/git/archaeology.d.ts +20 -0
  14. package/dist/analysis/git/archaeology.d.ts.map +1 -0
  15. package/dist/analysis/git/archaeology.js +61 -0
  16. package/dist/analysis/git/archaeology.js.map +1 -0
  17. package/dist/analysis/git/bus-factor.d.ts +17 -0
  18. package/dist/analysis/git/bus-factor.d.ts.map +1 -0
  19. package/dist/analysis/git/bus-factor.js +90 -0
  20. package/dist/analysis/git/bus-factor.js.map +1 -0
  21. package/dist/analysis/git/churn.d.ts +26 -0
  22. package/dist/analysis/git/churn.d.ts.map +1 -0
  23. package/dist/analysis/git/churn.js +127 -0
  24. package/dist/analysis/git/churn.js.map +1 -0
  25. package/dist/analysis/git/contributors.d.ts +14 -0
  26. package/dist/analysis/git/contributors.d.ts.map +1 -0
  27. package/dist/analysis/git/contributors.js +60 -0
  28. package/dist/analysis/git/contributors.js.map +1 -0
  29. package/dist/analysis/git/evolution.d.ts +10 -0
  30. package/dist/analysis/git/evolution.d.ts.map +1 -0
  31. package/dist/analysis/git/evolution.js +127 -0
  32. package/dist/analysis/git/evolution.js.map +1 -0
  33. package/dist/analysis/git/index.d.ts +6 -0
  34. package/dist/analysis/git/index.d.ts.map +1 -0
  35. package/dist/analysis/git/index.js +6 -0
  36. package/dist/analysis/git/index.js.map +1 -0
  37. package/dist/analysis/go-visitor.d.ts +4 -0
  38. package/dist/analysis/go-visitor.d.ts.map +1 -0
  39. package/dist/analysis/go-visitor.js +295 -0
  40. package/dist/analysis/go-visitor.js.map +1 -0
  41. package/dist/analysis/health/indicators.d.ts +25 -0
  42. package/dist/analysis/health/indicators.d.ts.map +1 -0
  43. package/dist/analysis/health/indicators.js +53 -0
  44. package/dist/analysis/health/indicators.js.map +1 -0
  45. package/dist/analysis/health/scorer.d.ts +26 -0
  46. package/dist/analysis/health/scorer.d.ts.map +1 -0
  47. package/dist/analysis/health/scorer.js +97 -0
  48. package/dist/analysis/health/scorer.js.map +1 -0
  49. package/dist/analysis/health/test-coverage.d.ts +19 -0
  50. package/dist/analysis/health/test-coverage.d.ts.map +1 -0
  51. package/dist/analysis/health/test-coverage.js +67 -0
  52. package/dist/analysis/health/test-coverage.js.map +1 -0
  53. package/dist/analysis/import-resolver.d.ts +10 -0
  54. package/dist/analysis/import-resolver.d.ts.map +1 -0
  55. package/dist/analysis/import-resolver.js +353 -0
  56. package/dist/analysis/import-resolver.js.map +1 -0
  57. package/dist/analysis/index.d.ts +22 -0
  58. package/dist/analysis/index.d.ts.map +1 -0
  59. package/dist/analysis/index.js +24 -0
  60. package/dist/analysis/index.js.map +1 -0
  61. package/dist/analysis/java-visitor.d.ts +4 -0
  62. package/dist/analysis/java-visitor.d.ts.map +1 -0
  63. package/dist/analysis/java-visitor.js +257 -0
  64. package/dist/analysis/java-visitor.js.map +1 -0
  65. package/dist/analysis/metrics.d.ts +19 -0
  66. package/dist/analysis/metrics.d.ts.map +1 -0
  67. package/dist/analysis/metrics.js +70 -0
  68. package/dist/analysis/metrics.js.map +1 -0
  69. package/dist/analysis/module-detector.d.ts +3 -0
  70. package/dist/analysis/module-detector.d.ts.map +1 -0
  71. package/dist/analysis/module-detector.js +257 -0
  72. package/dist/analysis/module-detector.js.map +1 -0
  73. package/dist/analysis/parser.d.ts +13 -0
  74. package/dist/analysis/parser.d.ts.map +1 -0
  75. package/dist/analysis/parser.js +92 -0
  76. package/dist/analysis/parser.js.map +1 -0
  77. package/dist/analysis/python-visitor.d.ts +4 -0
  78. package/dist/analysis/python-visitor.d.ts.map +1 -0
  79. package/dist/analysis/python-visitor.js +306 -0
  80. package/dist/analysis/python-visitor.js.map +1 -0
  81. package/dist/analysis/rust-visitor.d.ts +4 -0
  82. package/dist/analysis/rust-visitor.d.ts.map +1 -0
  83. package/dist/analysis/rust-visitor.js +318 -0
  84. package/dist/analysis/rust-visitor.js.map +1 -0
  85. package/dist/analysis/semantic/cache.d.ts +16 -0
  86. package/dist/analysis/semantic/cache.d.ts.map +1 -0
  87. package/dist/analysis/semantic/cache.js +26 -0
  88. package/dist/analysis/semantic/cache.js.map +1 -0
  89. package/dist/analysis/semantic/openai-client.d.ts +21 -0
  90. package/dist/analysis/semantic/openai-client.d.ts.map +1 -0
  91. package/dist/analysis/semantic/openai-client.js +73 -0
  92. package/dist/analysis/semantic/openai-client.js.map +1 -0
  93. package/dist/analysis/semantic/prompts.d.ts +32 -0
  94. package/dist/analysis/semantic/prompts.d.ts.map +1 -0
  95. package/dist/analysis/semantic/prompts.js +134 -0
  96. package/dist/analysis/semantic/prompts.js.map +1 -0
  97. package/dist/analysis/semantic/summarizer.d.ts +36 -0
  98. package/dist/analysis/semantic/summarizer.d.ts.map +1 -0
  99. package/dist/analysis/semantic/summarizer.js +229 -0
  100. package/dist/analysis/semantic/summarizer.js.map +1 -0
  101. package/dist/analysis/ts-js-visitor.d.ts +4 -0
  102. package/dist/analysis/ts-js-visitor.d.ts.map +1 -0
  103. package/dist/analysis/ts-js-visitor.js +390 -0
  104. package/dist/analysis/ts-js-visitor.js.map +1 -0
  105. package/dist/analysis/visitor-registry.d.ts +5 -0
  106. package/dist/analysis/visitor-registry.d.ts.map +1 -0
  107. package/dist/analysis/visitor-registry.js +17 -0
  108. package/dist/analysis/visitor-registry.js.map +1 -0
  109. package/dist/analysis/visitor-utils.d.ts +38 -0
  110. package/dist/analysis/visitor-utils.d.ts.map +1 -0
  111. package/dist/analysis/visitor-utils.js +110 -0
  112. package/dist/analysis/visitor-utils.js.map +1 -0
  113. package/dist/errors.d.ts +20 -0
  114. package/dist/errors.d.ts.map +1 -0
  115. package/dist/errors.js +39 -0
  116. package/dist/errors.js.map +1 -0
  117. package/dist/expeditions/custom.d.ts +11 -0
  118. package/dist/expeditions/custom.d.ts.map +1 -0
  119. package/dist/expeditions/custom.js +61 -0
  120. package/dist/expeditions/custom.js.map +1 -0
  121. package/dist/expeditions/danger-zones.d.ts +9 -0
  122. package/dist/expeditions/danger-zones.d.ts.map +1 -0
  123. package/dist/expeditions/danger-zones.js +42 -0
  124. package/dist/expeditions/danger-zones.js.map +1 -0
  125. package/dist/expeditions/generator.d.ts +21 -0
  126. package/dist/expeditions/generator.d.ts.map +1 -0
  127. package/dist/expeditions/generator.js +78 -0
  128. package/dist/expeditions/generator.js.map +1 -0
  129. package/dist/expeditions/grand-tour.d.ts +10 -0
  130. package/dist/expeditions/grand-tour.d.ts.map +1 -0
  131. package/dist/expeditions/grand-tour.js +96 -0
  132. package/dist/expeditions/grand-tour.js.map +1 -0
  133. package/dist/expeditions/request-flow.d.ts +11 -0
  134. package/dist/expeditions/request-flow.d.ts.map +1 -0
  135. package/dist/expeditions/request-flow.js +138 -0
  136. package/dist/expeditions/request-flow.js.map +1 -0
  137. package/dist/grammars/tree-sitter-go.wasm +0 -0
  138. package/dist/grammars/tree-sitter-java.wasm +0 -0
  139. package/dist/grammars/tree-sitter-javascript.wasm +0 -0
  140. package/dist/grammars/tree-sitter-python.wasm +0 -0
  141. package/dist/grammars/tree-sitter-rust.wasm +0 -0
  142. package/dist/grammars/tree-sitter-tsx.wasm +0 -0
  143. package/dist/grammars/tree-sitter-typescript.wasm +0 -0
  144. package/dist/graph/builder.d.ts +23 -0
  145. package/dist/graph/builder.d.ts.map +1 -0
  146. package/dist/graph/builder.js +131 -0
  147. package/dist/graph/builder.js.map +1 -0
  148. package/dist/graph/exporter.d.ts +5 -0
  149. package/dist/graph/exporter.d.ts.map +1 -0
  150. package/dist/graph/exporter.js +20 -0
  151. package/dist/graph/exporter.js.map +1 -0
  152. package/dist/graph/layout.d.ts +3 -0
  153. package/dist/graph/layout.d.ts.map +1 -0
  154. package/dist/graph/layout.js +257 -0
  155. package/dist/graph/layout.js.map +1 -0
  156. package/dist/graph/store.d.ts +13 -0
  157. package/dist/graph/store.d.ts.map +1 -0
  158. package/dist/graph/store.js +145 -0
  159. package/dist/graph/store.js.map +1 -0
  160. package/dist/index.d.ts +17 -0
  161. package/dist/index.d.ts.map +1 -0
  162. package/dist/index.js +12 -0
  163. package/dist/index.js.map +1 -0
  164. package/dist/ingestion/cloner.d.ts +18 -0
  165. package/dist/ingestion/cloner.d.ts.map +1 -0
  166. package/dist/ingestion/cloner.js +62 -0
  167. package/dist/ingestion/cloner.js.map +1 -0
  168. package/dist/ingestion/file-tree.d.ts +3 -0
  169. package/dist/ingestion/file-tree.d.ts.map +1 -0
  170. package/dist/ingestion/file-tree.js +85 -0
  171. package/dist/ingestion/file-tree.js.map +1 -0
  172. package/dist/ingestion/index.d.ts +5 -0
  173. package/dist/ingestion/index.d.ts.map +1 -0
  174. package/dist/ingestion/index.js +5 -0
  175. package/dist/ingestion/index.js.map +1 -0
  176. package/dist/ingestion/language-detector.d.ts +8 -0
  177. package/dist/ingestion/language-detector.d.ts.map +1 -0
  178. package/dist/ingestion/language-detector.js +37 -0
  179. package/dist/ingestion/language-detector.js.map +1 -0
  180. package/dist/ingestion/path-resolver.d.ts +7 -0
  181. package/dist/ingestion/path-resolver.d.ts.map +1 -0
  182. package/dist/ingestion/path-resolver.js +30 -0
  183. package/dist/ingestion/path-resolver.js.map +1 -0
  184. package/dist/logger.d.ts +3 -0
  185. package/dist/logger.d.ts.map +1 -0
  186. package/dist/logger.js +11 -0
  187. package/dist/logger.js.map +1 -0
  188. package/dist/pipeline.d.ts +3 -0
  189. package/dist/pipeline.d.ts.map +1 -0
  190. package/dist/pipeline.js +223 -0
  191. package/dist/pipeline.js.map +1 -0
  192. package/dist/types/analysis.d.ts +51 -0
  193. package/dist/types/analysis.d.ts.map +1 -0
  194. package/dist/types/analysis.js +2 -0
  195. package/dist/types/analysis.js.map +1 -0
  196. package/dist/types/config.d.ts +19 -0
  197. package/dist/types/config.d.ts.map +1 -0
  198. package/dist/types/config.js +2 -0
  199. package/dist/types/config.js.map +1 -0
  200. package/dist/types/edges.d.ts +8 -0
  201. package/dist/types/edges.d.ts.map +1 -0
  202. package/dist/types/edges.js +2 -0
  203. package/dist/types/edges.js.map +1 -0
  204. package/dist/types/expeditions.d.ts +19 -0
  205. package/dist/types/expeditions.d.ts.map +1 -0
  206. package/dist/types/expeditions.js +2 -0
  207. package/dist/types/expeditions.js.map +1 -0
  208. package/dist/types/graph.d.ts +29 -0
  209. package/dist/types/graph.d.ts.map +1 -0
  210. package/dist/types/graph.js +2 -0
  211. package/dist/types/graph.js.map +1 -0
  212. package/dist/types/index.d.ts +7 -0
  213. package/dist/types/index.d.ts.map +1 -0
  214. package/dist/types/index.js +2 -0
  215. package/dist/types/index.js.map +1 -0
  216. package/dist/types/nodes.d.ts +35 -0
  217. package/dist/types/nodes.d.ts.map +1 -0
  218. package/dist/types/nodes.js +2 -0
  219. package/dist/types/nodes.js.map +1 -0
  220. package/package.json +36 -0
@@ -0,0 +1,127 @@
1
+ import fs from "node:fs";
2
+ import git from "isomorphic-git";
3
+ import { logger } from "../../logger.js";
4
+ /**
5
+ * Compute churn data for all files in the repository.
6
+ *
7
+ * Uses isomorphic-git.log() with filepath to get per-file commit history.
8
+ * Lines changed is approximated using commit count as a proxy (actual line
9
+ * diffs are expensive with isomorphic-git).
10
+ *
11
+ * Formula:
12
+ * rawChurn = (distinctAuthors/maxAuthors * 0.3)
13
+ * + (commitsLast90d/max(totalCommits,1) * 0.3)
14
+ * + (commitsLast90d/max(totalCommits,1) * 0.4) // simplified proxy
15
+ *
16
+ * Result is then normalized across all files to 0-1 range.
17
+ */
18
+ export async function computeChurn(gitDir, filePaths) {
19
+ const result = new Map();
20
+ const now = Math.floor(Date.now() / 1000);
21
+ const ninetyDaysAgo = now - 90 * 24 * 60 * 60;
22
+ // Gather per-file commit data
23
+ for (const filePath of filePaths) {
24
+ try {
25
+ const commits = await getFileCommits(gitDir, filePath);
26
+ const authors = commits.map((c) => c.author);
27
+ const distinctAuthors = new Set(authors).size;
28
+ const totalCommits = commits.length;
29
+ const commitsLast90d = commits.filter((c) => c.timestamp >= ninetyDaysAgo).length;
30
+ // Find primary author (most frequent committer)
31
+ const authorCounts = new Map();
32
+ for (const a of authors) {
33
+ authorCounts.set(a, (authorCounts.get(a) ?? 0) + 1);
34
+ }
35
+ let primaryAuthor = null;
36
+ let maxCount = 0;
37
+ for (const [author, count] of authorCounts) {
38
+ if (count > maxCount) {
39
+ maxCount = count;
40
+ primaryAuthor = author;
41
+ }
42
+ }
43
+ // Sort by timestamp to find first and last
44
+ const sorted = [...commits].sort((a, b) => a.timestamp - b.timestamp);
45
+ const createdAt = sorted.length > 0
46
+ ? new Date(sorted[0].timestamp * 1000).toISOString()
47
+ : null;
48
+ const lastModified = sorted.length > 0
49
+ ? new Date(sorted[sorted.length - 1].timestamp * 1000).toISOString()
50
+ : null;
51
+ result.set(filePath, {
52
+ distinctAuthors,
53
+ totalCommits,
54
+ commitsLast90d,
55
+ linesChangedLast90d: commitsLast90d,
56
+ churnScore: 0,
57
+ createdAt,
58
+ lastModified,
59
+ primaryAuthor,
60
+ });
61
+ }
62
+ catch (err) {
63
+ logger.debug(`Churn: skipping ${filePath} — ${err instanceof Error ? err.message : err}`);
64
+ result.set(filePath, {
65
+ distinctAuthors: 0,
66
+ totalCommits: 0,
67
+ commitsLast90d: 0,
68
+ linesChangedLast90d: 0,
69
+ churnScore: 0,
70
+ createdAt: null,
71
+ lastModified: null,
72
+ primaryAuthor: null,
73
+ });
74
+ }
75
+ }
76
+ // Compute raw churn scores and normalize
77
+ normalizeChurnScores(result);
78
+ return result;
79
+ }
80
+ async function getFileCommits(gitDir, filePath) {
81
+ try {
82
+ const logs = await git.log({
83
+ fs,
84
+ dir: gitDir,
85
+ filepath: filePath,
86
+ depth: 500, // limit for performance
87
+ });
88
+ return logs.map((entry) => ({
89
+ oid: entry.oid,
90
+ author: entry.commit.author.name,
91
+ timestamp: entry.commit.author.timestamp,
92
+ }));
93
+ }
94
+ catch {
95
+ // File may not exist in git history (untracked)
96
+ return [];
97
+ }
98
+ }
99
+ function normalizeChurnScores(churnMap) {
100
+ if (churnMap.size === 0)
101
+ return;
102
+ // Find max values across all files for normalization
103
+ let maxAuthors = 1;
104
+ for (const data of churnMap.values()) {
105
+ if (data.distinctAuthors > maxAuthors)
106
+ maxAuthors = data.distinctAuthors;
107
+ }
108
+ // Compute raw scores
109
+ const rawScores = new Map();
110
+ let maxRaw = 0;
111
+ for (const [path, data] of churnMap) {
112
+ const authorComponent = (data.distinctAuthors / maxAuthors) * 0.3;
113
+ const recentCommitRatio = data.commitsLast90d / Math.max(data.totalCommits, 1);
114
+ const activityComponent = recentCommitRatio * 0.3;
115
+ const changeComponent = recentCommitRatio * 0.4; // simplified proxy
116
+ const raw = authorComponent + activityComponent + changeComponent;
117
+ rawScores.set(path, raw);
118
+ if (raw > maxRaw)
119
+ maxRaw = raw;
120
+ }
121
+ // Normalize to 0-1
122
+ for (const [path, data] of churnMap) {
123
+ const raw = rawScores.get(path) ?? 0;
124
+ data.churnScore = maxRaw > 0 ? raw / maxRaw : 0;
125
+ }
126
+ }
127
+ //# sourceMappingURL=churn.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"churn.js","sourceRoot":"","sources":["../../../src/analysis/git/churn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,GAAG,MAAM,gBAAgB,CAAC;AACjC,OAAO,EAAE,MAAM,E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,MAAM,GAAG,CAAC,CAAC;IAEf,KAAK,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,QAAQ,EAAE,CAAC;QACpC,MAAM,eAAe,GAAG,CAAC,IAAI,CAAC,eAAe,GAAG,UAAU,CAAC,GAAG,GAAG,CAAC;QAClE,MAAM,iBAAiB,GAAG,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC;QAC/E,MAAM,iBAAiB,GAAG,iBAAiB,GAAG,GAAG,CAAC;QAClD,MAAM,eAAe,GAAG,iBAAiB,GAAG,GAAG,CAAC,CAAC,mBAAmB;QAEpE,MAAM,GAAG,GAAG,eAAe,GAAG,iBAAiB,GAAG,eAAe,CAAC;QAClE,SAAS,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QACzB,IAAI,GAAG,GAAG,MAAM;YAAE,MAAM,GAAG,GAAG,CAAC;IACjC,CAAC;IAED,mBAAmB;IACnB,KAAK,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,QAAQ,EAAE,CAAC;QACpC,MAAM,GAAG,GAAG,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACrC,IAAI,CAAC,UAAU,GAAG,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IAClD,CAAC;AACH,CAAC"}
@@ -0,0 +1,14 @@
1
+ export interface ContributorInfo {
2
+ name: string;
3
+ email: string;
4
+ commits: number;
5
+ avatarUrl: string;
6
+ }
7
+ /**
8
+ * Extract deduplicated contributor list from git history.
9
+ *
10
+ * Deduplicates by email address (case-insensitive, trimmed).
11
+ * Generates Gravatar URLs using MD5 hash of the email.
12
+ */
13
+ export declare function getContributors(gitDir: string): Promise<ContributorInfo[]>;
14
+ //# sourceMappingURL=contributors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contributors.d.ts","sourceRoot":"","sources":["../../../src/analysis/git/contributors.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;;GAKG;AACH,wBAAsB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC,CA2ChF"}
@@ -0,0 +1,60 @@
1
+ import fs from "node:fs";
2
+ import { createHash } from "node:crypto";
3
+ import git from "isomorphic-git";
4
+ import { logger } from "../../logger.js";
5
+ /**
6
+ * Extract deduplicated contributor list from git history.
7
+ *
8
+ * Deduplicates by email address (case-insensitive, trimmed).
9
+ * Generates Gravatar URLs using MD5 hash of the email.
10
+ */
11
+ export async function getContributors(gitDir) {
12
+ try {
13
+ const logs = await git.log({ fs, dir: gitDir, depth: 500 });
14
+ // Aggregate by email (lowercase, trimmed)
15
+ const contributorMap = new Map();
16
+ for (const entry of logs) {
17
+ const { name, email } = entry.commit.author;
18
+ const normalizedEmail = email.trim().toLowerCase();
19
+ const existing = contributorMap.get(normalizedEmail);
20
+ if (existing) {
21
+ existing.commits++;
22
+ // Keep the most recent name (first seen, since log is reverse chronological)
23
+ }
24
+ else {
25
+ contributorMap.set(normalizedEmail, {
26
+ name,
27
+ email: normalizedEmail,
28
+ commits: 1,
29
+ });
30
+ }
31
+ }
32
+ // Convert to array, sort by commit count descending
33
+ const contributors = [];
34
+ for (const data of contributorMap.values()) {
35
+ contributors.push({
36
+ name: data.name,
37
+ email: data.email,
38
+ commits: data.commits,
39
+ avatarUrl: gravatarUrl(data.email),
40
+ });
41
+ }
42
+ contributors.sort((a, b) => b.commits - a.commits);
43
+ return contributors;
44
+ }
45
+ catch (err) {
46
+ logger.warn(`Contributors: failed to read git log — ${err instanceof Error ? err.message : err}`);
47
+ return [];
48
+ }
49
+ }
50
+ /**
51
+ * Generate a Gravatar URL from an email address.
52
+ * Uses MD5 hash of the trimmed, lowercase email.
53
+ */
54
+ function gravatarUrl(email) {
55
+ const hash = createHash("md5")
56
+ .update(email.trim().toLowerCase())
57
+ .digest("hex");
58
+ return `https://www.gravatar.com/avatar/${hash}?d=identicon&s=64`;
59
+ }
60
+ //# sourceMappingURL=contributors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contributors.js","sourceRoot":"","sources":["../../../src/analysis/git/contributors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,GAAG,MAAM,gBAAgB,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AASzC;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,MAAc;IAClD,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;QAE5D,0CAA0C;QAC1C,MAAM,cAAc,GAAG,IAAI,GAAG,EAA4D,CAAC;QAE3F,KAAK,MAAM,KAAK,IAAI,IAAI,EAAE,CAAC;YACzB,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC;YAC5C,MAAM,eAAe,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;YAEnD,MAAM,QAAQ,GAAG,cAAc,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;YACrD,IAAI,QAAQ,EAAE,CAAC;gBACb,QAAQ,CAAC,OAAO,EAAE,CAAC;gBACnB,6EAA6E;YAC/E,CAAC;iBAAM,CAAC;gBACN,cAAc,CAAC,GAAG,CAAC,eAAe,EAAE;oBAClC,IAAI;oBACJ,KAAK,EAAE,eAAe;oBACtB,OAAO,EAAE,CAAC;iBACX,CAAC,CAAC;YACL,CAAC;QACH,CAAC;QAED,oDAAoD;QACpD,MAAM,YAAY,GAAsB,EAAE,CAAC;QAC3C,KAAK,MAAM,IAAI,IAAI,cAAc,CAAC,MAAM,EAAE,EAAE,CAAC;YAC3C,YAAY,CAAC,IAAI,CAAC;gBAChB,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,SAAS,EAAE,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC;aACnC,CAAC,CAAC;QACL,CAAC;QAED,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC;QACnD,OAAO,YAAY,CAAC;IACtB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,CAAC,IAAI,CACT,0CAA0C,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,CACrF,CAAC;QACF,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,SAAS,WAAW,CAAC,KAAa;IAChC,MAAM,IAAI,GAAG,UAAU,CAAC,KAAK,CAAC;SAC3B,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;SAClC,MAAM,CAAC,KAAK,CAAC,CAAC;IACjB,OAAO,mCAAmC,IAAI,mBAAmB,CAAC;AACpE,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { EvolutionSnapshot } from "../../types/index.js";
2
+ /**
3
+ * Build an evolution timeline by sampling commits at regular intervals.
4
+ *
5
+ * We aim for 20-50 snapshots. For each sampled commit, we list the files
6
+ * present in that commit's tree and compare against the previous sample
7
+ * to compute nodesAdded, nodesRemoved, nodesModified.
8
+ */
9
+ export declare function buildEvolutionTimeline(gitDir: string, filePaths: string[]): Promise<EvolutionSnapshot[]>;
10
+ //# sourceMappingURL=evolution.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"evolution.d.ts","sourceRoot":"","sources":["../../../src/analysis/git/evolution.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D;;;;;;GAMG;AACH,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EAAE,GAClB,OAAO,CAAC,iBAAiB,EAAE,CAAC,CA2G9B"}
@@ -0,0 +1,127 @@
1
+ import fs from "node:fs";
2
+ import git from "isomorphic-git";
3
+ import { logger } from "../../logger.js";
4
+ /**
5
+ * Build an evolution timeline by sampling commits at regular intervals.
6
+ *
7
+ * We aim for 20-50 snapshots. For each sampled commit, we list the files
8
+ * present in that commit's tree and compare against the previous sample
9
+ * to compute nodesAdded, nodesRemoved, nodesModified.
10
+ */
11
+ export async function buildEvolutionTimeline(gitDir, filePaths) {
12
+ try {
13
+ // Get all commits (limited for perf)
14
+ const logs = await git.log({ fs, dir: gitDir, depth: 500 });
15
+ if (logs.length === 0) {
16
+ return [];
17
+ }
18
+ // logs are in reverse chronological order (newest first)
19
+ // Reverse so we process oldest first
20
+ const chronological = [...logs].reverse();
21
+ // Compute sampling interval: aim for ~30 snapshots
22
+ const targetSnapshots = 30;
23
+ const step = Math.max(1, Math.floor(chronological.length / targetSnapshots));
24
+ // Always include first and last
25
+ const sampleIndices = [];
26
+ for (let i = 0; i < chronological.length; i += step) {
27
+ sampleIndices.push(i);
28
+ }
29
+ // Ensure last commit is included
30
+ const lastIdx = chronological.length - 1;
31
+ if (sampleIndices[sampleIndices.length - 1] !== lastIdx) {
32
+ sampleIndices.push(lastIdx);
33
+ }
34
+ // Build the known file set for matching
35
+ const knownFiles = new Set(filePaths);
36
+ const snapshots = [];
37
+ let previousFiles = new Set();
38
+ for (const idx of sampleIndices) {
39
+ const entry = chronological[idx];
40
+ try {
41
+ // List files in this commit's tree
42
+ const treeFiles = await listFilesAtCommit(gitDir, entry.oid);
43
+ // Filter to known file paths (those the analysis cares about)
44
+ const currentFiles = new Set();
45
+ for (const f of treeFiles) {
46
+ if (knownFiles.has(f)) {
47
+ currentFiles.add(f);
48
+ }
49
+ }
50
+ // Compare with previous snapshot
51
+ const nodesAdded = [];
52
+ const nodesRemoved = [];
53
+ const nodesModified = [];
54
+ for (const f of currentFiles) {
55
+ if (!previousFiles.has(f)) {
56
+ nodesAdded.push(`file:${f}`);
57
+ }
58
+ }
59
+ for (const f of previousFiles) {
60
+ if (!currentFiles.has(f)) {
61
+ nodesRemoved.push(`file:${f}`);
62
+ }
63
+ else {
64
+ // File existed in both — mark as modified (simplification;
65
+ // we don't actually diff, but the file survived between samples
66
+ // so it may have been modified in the intervening commits)
67
+ }
68
+ }
69
+ // For modified: files that exist in both but were likely changed
70
+ // We'll mark files that had commits between this sample and the previous
71
+ // as "modified". For simplicity, only non-newly-added files that exist
72
+ // in both snapshots are candidates.
73
+ if (snapshots.length > 0) {
74
+ for (const f of currentFiles) {
75
+ if (previousFiles.has(f) && !nodesAdded.includes(`file:${f}`)) {
76
+ nodesModified.push(`file:${f}`);
77
+ }
78
+ }
79
+ }
80
+ snapshots.push({
81
+ commitHash: entry.oid,
82
+ timestamp: new Date(entry.commit.author.timestamp * 1000).toISOString(),
83
+ author: entry.commit.author.name,
84
+ nodesAdded,
85
+ nodesRemoved,
86
+ nodesModified,
87
+ summary: entry.commit.message.split("\n")[0] ?? "",
88
+ });
89
+ previousFiles = currentFiles;
90
+ }
91
+ catch (err) {
92
+ logger.debug(`Evolution: skipping commit ${entry.oid.slice(0, 7)} — ${err instanceof Error ? err.message : err}`);
93
+ }
94
+ }
95
+ return snapshots;
96
+ }
97
+ catch (err) {
98
+ logger.warn(`Evolution: failed to build timeline — ${err instanceof Error ? err.message : err}`);
99
+ return [];
100
+ }
101
+ }
102
+ /**
103
+ * List all file paths in a commit's tree using TREE walk.
104
+ */
105
+ async function listFilesAtCommit(gitDir, oid) {
106
+ const files = [];
107
+ await git.walk({
108
+ fs,
109
+ dir: gitDir,
110
+ trees: [git.TREE({ ref: oid })],
111
+ map: async (filepath, entries) => {
112
+ if (!entries || entries.length === 0)
113
+ return undefined;
114
+ const entry = entries[0];
115
+ if (!entry)
116
+ return undefined;
117
+ const type = await entry.type();
118
+ if (type === "blob" && filepath !== ".") {
119
+ files.push(filepath);
120
+ }
121
+ // Return filepath to continue walking into subdirectories
122
+ return filepath;
123
+ },
124
+ });
125
+ return files;
126
+ }
127
+ //# sourceMappingURL=evolution.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"evolution.js","sourceRoot":"","sources":["../../../src/analysis/git/evolution.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,GAAG,MAAM,gBAAgB,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAGzC;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,MAAc,EACd,SAAmB;IAEnB,IAAI,CAAC;QACH,qCAAqC;QACrC,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;QAE5D,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACtB,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,yDAAyD;QACzD,qCAAqC;QACrC,MAAM,aAAa,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;QAE1C,mDAAmD;QACnD,MAAM,eAAe,GAAG,EAAE,CAAC;QAC3B,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,K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,IAAI,QAAQ,KAAK,GAAG,EAAE,CAAC;gBACxC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YACvB,CAAC;YAED,0DAA0D;YAC1D,OAAO,QAAQ,CAAC;QAClB,CAAC;KACF,CAAC,CAAC;IAEH,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1,6 @@
1
+ export { analyzeGitHistory, type GitArchaeologyResult } from "./archaeology.js";
2
+ export { computeChurn, type ChurnData } from "./churn.js";
3
+ export { computeBusFactors, type BusFactorData } from "./bus-factor.js";
4
+ export { getContributors, type ContributorInfo } from "./contributors.js";
5
+ export { buildEvolutionTimeline } from "./evolution.js";
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/analysis/git/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,KAAK,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,6 @@
1
+ export { analyzeGitHistory } from "./archaeology.js";
2
+ export { computeChurn } from "./churn.js";
3
+ export { computeBusFactors } from "./bus-factor.js";
4
+ export { getContributors } from "./contributors.js";
5
+ export { buildEvolutionTimeline } from "./evolution.js";
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/analysis/git/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAA6B,MAAM,kBAAkB,CAAC;AAChF,OAAO,EAAE,YAAY,EAAkB,MAAM,YAAY,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAsB,MAAM,iBAAiB,CAAC;AACxE,OAAO,EAAE,eAAe,EAAwB,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type Parser from "web-tree-sitter";
2
+ import type { FileAnalysis } from "../types/index.js";
3
+ export declare function visitFile(content: string, tree: Parser.Tree, filePath: string): FileAnalysis;
4
+ //# sourceMappingURL=go-visitor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"go-visitor.d.ts","sourceRoot":"","sources":["../../src/analysis/go-visitor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,iBAAiB,CAAC;AAC1C,OAAO,KAAK,EAAE,YAAY,EAA2E,MAAM,mBAAmB,CAAC;AAuS/H,wBAAgB,SAAS,CACvB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,CAAC,IAAI,EACjB,QAAQ,EAAE,MAAM,GACf,YAAY,CAgBd"}