driftdetect-core 0.4.1 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (237) hide show
  1. package/dist/boundaries/boundary-scanner.d.ts +76 -0
  2. package/dist/boundaries/boundary-scanner.d.ts.map +1 -0
  3. package/dist/boundaries/boundary-scanner.js +801 -0
  4. package/dist/boundaries/boundary-scanner.js.map +1 -0
  5. package/dist/boundaries/data-access-learner.d.ts +126 -0
  6. package/dist/boundaries/data-access-learner.d.ts.map +1 -0
  7. package/dist/boundaries/data-access-learner.js +486 -0
  8. package/dist/boundaries/data-access-learner.js.map +1 -0
  9. package/dist/boundaries/index.d.ts +6 -0
  10. package/dist/boundaries/index.d.ts.map +1 -1
  11. package/dist/boundaries/index.js +6 -0
  12. package/dist/boundaries/index.js.map +1 -1
  13. package/dist/boundaries/security-prioritizer.d.ts +118 -0
  14. package/dist/boundaries/security-prioritizer.d.ts.map +1 -0
  15. package/dist/boundaries/security-prioritizer.js +316 -0
  16. package/dist/boundaries/security-prioritizer.js.map +1 -0
  17. package/dist/call-graph/analysis/coverage-analyzer.d.ts +201 -0
  18. package/dist/call-graph/analysis/coverage-analyzer.d.ts.map +1 -0
  19. package/dist/call-graph/analysis/coverage-analyzer.js +553 -0
  20. package/dist/call-graph/analysis/coverage-analyzer.js.map +1 -0
  21. package/dist/call-graph/analysis/dead-code-detector.d.ts +145 -0
  22. package/dist/call-graph/analysis/dead-code-detector.d.ts.map +1 -0
  23. package/dist/call-graph/analysis/dead-code-detector.js +391 -0
  24. package/dist/call-graph/analysis/dead-code-detector.js.map +1 -0
  25. package/dist/call-graph/analysis/graph-builder.d.ts +142 -0
  26. package/dist/call-graph/analysis/graph-builder.d.ts.map +1 -0
  27. package/dist/call-graph/analysis/graph-builder.js +624 -0
  28. package/dist/call-graph/analysis/graph-builder.js.map +1 -0
  29. package/dist/call-graph/analysis/impact-analyzer.d.ts +150 -0
  30. package/dist/call-graph/analysis/impact-analyzer.d.ts.map +1 -0
  31. package/dist/call-graph/analysis/impact-analyzer.js +329 -0
  32. package/dist/call-graph/analysis/impact-analyzer.js.map +1 -0
  33. package/dist/call-graph/analysis/index.d.ts +11 -0
  34. package/dist/call-graph/analysis/index.d.ts.map +1 -0
  35. package/dist/call-graph/analysis/index.js +9 -0
  36. package/dist/call-graph/analysis/index.js.map +1 -0
  37. package/dist/call-graph/analysis/path-finder.d.ts +117 -0
  38. package/dist/call-graph/analysis/path-finder.d.ts.map +1 -0
  39. package/dist/call-graph/analysis/path-finder.js +360 -0
  40. package/dist/call-graph/analysis/path-finder.js.map +1 -0
  41. package/dist/call-graph/analysis/reachability.d.ts +56 -0
  42. package/dist/call-graph/analysis/reachability.d.ts.map +1 -0
  43. package/dist/call-graph/analysis/reachability.js +357 -0
  44. package/dist/call-graph/analysis/reachability.js.map +1 -0
  45. package/dist/call-graph/demo.d.ts +11 -0
  46. package/dist/call-graph/demo.d.ts.map +1 -0
  47. package/dist/call-graph/demo.js +339 -0
  48. package/dist/call-graph/demo.js.map +1 -0
  49. package/dist/call-graph/enrichment/enrichment-engine.d.ts +126 -0
  50. package/dist/call-graph/enrichment/enrichment-engine.d.ts.map +1 -0
  51. package/dist/call-graph/enrichment/enrichment-engine.js +760 -0
  52. package/dist/call-graph/enrichment/enrichment-engine.js.map +1 -0
  53. package/dist/call-graph/enrichment/impact-scorer.d.ts +59 -0
  54. package/dist/call-graph/enrichment/impact-scorer.d.ts.map +1 -0
  55. package/dist/call-graph/enrichment/impact-scorer.js +328 -0
  56. package/dist/call-graph/enrichment/impact-scorer.js.map +1 -0
  57. package/dist/call-graph/enrichment/index.d.ts +12 -0
  58. package/dist/call-graph/enrichment/index.d.ts.map +1 -0
  59. package/dist/call-graph/enrichment/index.js +15 -0
  60. package/dist/call-graph/enrichment/index.js.map +1 -0
  61. package/dist/call-graph/enrichment/remediation-generator.d.ts +41 -0
  62. package/dist/call-graph/enrichment/remediation-generator.d.ts.map +1 -0
  63. package/dist/call-graph/enrichment/remediation-generator.js +609 -0
  64. package/dist/call-graph/enrichment/remediation-generator.js.map +1 -0
  65. package/dist/call-graph/enrichment/sensitivity-classifier.d.ts +71 -0
  66. package/dist/call-graph/enrichment/sensitivity-classifier.d.ts.map +1 -0
  67. package/dist/call-graph/enrichment/sensitivity-classifier.js +454 -0
  68. package/dist/call-graph/enrichment/sensitivity-classifier.js.map +1 -0
  69. package/dist/call-graph/enrichment/types.d.ts +402 -0
  70. package/dist/call-graph/enrichment/types.d.ts.map +1 -0
  71. package/dist/call-graph/enrichment/types.js +9 -0
  72. package/dist/call-graph/enrichment/types.js.map +1 -0
  73. package/dist/call-graph/extractors/base-extractor.d.ts +112 -0
  74. package/dist/call-graph/extractors/base-extractor.d.ts.map +1 -0
  75. package/dist/call-graph/extractors/base-extractor.js +140 -0
  76. package/dist/call-graph/extractors/base-extractor.js.map +1 -0
  77. package/dist/call-graph/extractors/csharp-data-access-extractor.d.ts +76 -0
  78. package/dist/call-graph/extractors/csharp-data-access-extractor.d.ts.map +1 -0
  79. package/dist/call-graph/extractors/csharp-data-access-extractor.js +387 -0
  80. package/dist/call-graph/extractors/csharp-data-access-extractor.js.map +1 -0
  81. package/dist/call-graph/extractors/csharp-extractor.d.ts +87 -0
  82. package/dist/call-graph/extractors/csharp-extractor.d.ts.map +1 -0
  83. package/dist/call-graph/extractors/csharp-extractor.js +470 -0
  84. package/dist/call-graph/extractors/csharp-extractor.js.map +1 -0
  85. package/dist/call-graph/extractors/data-access-extractor.d.ts +76 -0
  86. package/dist/call-graph/extractors/data-access-extractor.d.ts.map +1 -0
  87. package/dist/call-graph/extractors/data-access-extractor.js +234 -0
  88. package/dist/call-graph/extractors/data-access-extractor.js.map +1 -0
  89. package/dist/call-graph/extractors/index.d.ts +26 -0
  90. package/dist/call-graph/extractors/index.d.ts.map +1 -0
  91. package/dist/call-graph/extractors/index.js +36 -0
  92. package/dist/call-graph/extractors/index.js.map +1 -0
  93. package/dist/call-graph/extractors/java-data-access-extractor.d.ts +101 -0
  94. package/dist/call-graph/extractors/java-data-access-extractor.d.ts.map +1 -0
  95. package/dist/call-graph/extractors/java-data-access-extractor.js +611 -0
  96. package/dist/call-graph/extractors/java-data-access-extractor.js.map +1 -0
  97. package/dist/call-graph/extractors/java-extractor.d.ts +87 -0
  98. package/dist/call-graph/extractors/java-extractor.d.ts.map +1 -0
  99. package/dist/call-graph/extractors/java-extractor.js +510 -0
  100. package/dist/call-graph/extractors/java-extractor.js.map +1 -0
  101. package/dist/call-graph/extractors/php-data-access-extractor.d.ts +93 -0
  102. package/dist/call-graph/extractors/php-data-access-extractor.d.ts.map +1 -0
  103. package/dist/call-graph/extractors/php-data-access-extractor.js +589 -0
  104. package/dist/call-graph/extractors/php-data-access-extractor.js.map +1 -0
  105. package/dist/call-graph/extractors/php-extractor.d.ts +104 -0
  106. package/dist/call-graph/extractors/php-extractor.d.ts.map +1 -0
  107. package/dist/call-graph/extractors/php-extractor.js +619 -0
  108. package/dist/call-graph/extractors/php-extractor.js.map +1 -0
  109. package/dist/call-graph/extractors/python-data-access-extractor.d.ts +90 -0
  110. package/dist/call-graph/extractors/python-data-access-extractor.d.ts.map +1 -0
  111. package/dist/call-graph/extractors/python-data-access-extractor.js +537 -0
  112. package/dist/call-graph/extractors/python-data-access-extractor.js.map +1 -0
  113. package/dist/call-graph/extractors/python-extractor.d.ts +98 -0
  114. package/dist/call-graph/extractors/python-extractor.d.ts.map +1 -0
  115. package/dist/call-graph/extractors/python-extractor.js +681 -0
  116. package/dist/call-graph/extractors/python-extractor.js.map +1 -0
  117. package/dist/call-graph/extractors/semantic-data-access-scanner.d.ts +91 -0
  118. package/dist/call-graph/extractors/semantic-data-access-scanner.d.ts.map +1 -0
  119. package/dist/call-graph/extractors/semantic-data-access-scanner.js +498 -0
  120. package/dist/call-graph/extractors/semantic-data-access-scanner.js.map +1 -0
  121. package/dist/call-graph/extractors/typescript-data-access-extractor.d.ts +122 -0
  122. package/dist/call-graph/extractors/typescript-data-access-extractor.d.ts.map +1 -0
  123. package/dist/call-graph/extractors/typescript-data-access-extractor.js +788 -0
  124. package/dist/call-graph/extractors/typescript-data-access-extractor.js.map +1 -0
  125. package/dist/call-graph/extractors/typescript-extractor.d.ts +145 -0
  126. package/dist/call-graph/extractors/typescript-extractor.d.ts.map +1 -0
  127. package/dist/call-graph/extractors/typescript-extractor.js +904 -0
  128. package/dist/call-graph/extractors/typescript-extractor.js.map +1 -0
  129. package/dist/call-graph/index.d.ts +127 -0
  130. package/dist/call-graph/index.d.ts.map +1 -0
  131. package/dist/call-graph/index.js +247 -0
  132. package/dist/call-graph/index.js.map +1 -0
  133. package/dist/call-graph/store/call-graph-store.d.ts +70 -0
  134. package/dist/call-graph/store/call-graph-store.d.ts.map +1 -0
  135. package/dist/call-graph/store/call-graph-store.js +210 -0
  136. package/dist/call-graph/store/call-graph-store.js.map +1 -0
  137. package/dist/call-graph/store/index.d.ts +7 -0
  138. package/dist/call-graph/store/index.d.ts.map +1 -0
  139. package/dist/call-graph/store/index.js +7 -0
  140. package/dist/call-graph/store/index.js.map +1 -0
  141. package/dist/call-graph/types.d.ts +376 -0
  142. package/dist/call-graph/types.d.ts.map +1 -0
  143. package/dist/call-graph/types.js +8 -0
  144. package/dist/call-graph/types.js.map +1 -0
  145. package/dist/index.d.ts +8 -0
  146. package/dist/index.d.ts.map +1 -1
  147. package/dist/index.js +12 -0
  148. package/dist/index.js.map +1 -1
  149. package/dist/lake/callgraph-shard-store.d.ts +168 -0
  150. package/dist/lake/callgraph-shard-store.d.ts.map +1 -0
  151. package/dist/lake/callgraph-shard-store.js +466 -0
  152. package/dist/lake/callgraph-shard-store.js.map +1 -0
  153. package/dist/lake/examples-store.d.ts +127 -0
  154. package/dist/lake/examples-store.d.ts.map +1 -0
  155. package/dist/lake/examples-store.js +389 -0
  156. package/dist/lake/examples-store.js.map +1 -0
  157. package/dist/lake/index-store.d.ts +82 -0
  158. package/dist/lake/index-store.d.ts.map +1 -0
  159. package/dist/lake/index-store.js +359 -0
  160. package/dist/lake/index-store.js.map +1 -0
  161. package/dist/lake/index.d.ts +93 -0
  162. package/dist/lake/index.d.ts.map +1 -0
  163. package/dist/lake/index.js +138 -0
  164. package/dist/lake/index.js.map +1 -0
  165. package/dist/lake/lake.bak/index-store.d.ts +82 -0
  166. package/dist/lake/lake.bak/index-store.d.ts.map +1 -0
  167. package/dist/lake/lake.bak/index-store.js +357 -0
  168. package/dist/lake/lake.bak/index-store.js.map +1 -0
  169. package/dist/lake/lake.bak/index.d.ts +81 -0
  170. package/dist/lake/lake.bak/index.d.ts.map +1 -0
  171. package/dist/lake/lake.bak/index.js +114 -0
  172. package/dist/lake/lake.bak/index.js.map +1 -0
  173. package/dist/lake/lake.bak/manifest-store.d.ts +51 -0
  174. package/dist/lake/lake.bak/manifest-store.d.ts.map +1 -0
  175. package/dist/lake/lake.bak/manifest-store.js +347 -0
  176. package/dist/lake/lake.bak/manifest-store.js.map +1 -0
  177. package/dist/lake/lake.bak/query-engine.d.ts +112 -0
  178. package/dist/lake/lake.bak/query-engine.d.ts.map +1 -0
  179. package/dist/lake/lake.bak/query-engine.js +370 -0
  180. package/dist/lake/lake.bak/query-engine.js.map +1 -0
  181. package/dist/lake/lake.bak/types.d.ts +428 -0
  182. package/dist/lake/lake.bak/types.d.ts.map +1 -0
  183. package/dist/lake/lake.bak/types.js +46 -0
  184. package/dist/lake/lake.bak/types.js.map +1 -0
  185. package/dist/lake/lake.bak/view-materializer.d.ts +70 -0
  186. package/dist/lake/lake.bak/view-materializer.d.ts.map +1 -0
  187. package/dist/lake/lake.bak/view-materializer.js +314 -0
  188. package/dist/lake/lake.bak/view-materializer.js.map +1 -0
  189. package/dist/lake/lake.bak/view-store.d.ts +57 -0
  190. package/dist/lake/lake.bak/view-store.d.ts.map +1 -0
  191. package/dist/lake/lake.bak/view-store.js +348 -0
  192. package/dist/lake/lake.bak/view-store.js.map +1 -0
  193. package/dist/lake/manifest-store.d.ts +51 -0
  194. package/dist/lake/manifest-store.d.ts.map +1 -0
  195. package/dist/lake/manifest-store.js +348 -0
  196. package/dist/lake/manifest-store.js.map +1 -0
  197. package/dist/lake/pattern-shard-store.d.ts +87 -0
  198. package/dist/lake/pattern-shard-store.d.ts.map +1 -0
  199. package/dist/lake/pattern-shard-store.js +347 -0
  200. package/dist/lake/pattern-shard-store.js.map +1 -0
  201. package/dist/lake/query-engine.d.ts +124 -0
  202. package/dist/lake/query-engine.d.ts.map +1 -0
  203. package/dist/lake/query-engine.js +453 -0
  204. package/dist/lake/query-engine.js.map +1 -0
  205. package/dist/lake/security-shard-store.d.ts +156 -0
  206. package/dist/lake/security-shard-store.d.ts.map +1 -0
  207. package/dist/lake/security-shard-store.js +498 -0
  208. package/dist/lake/security-shard-store.js.map +1 -0
  209. package/dist/lake/types.d.ts +428 -0
  210. package/dist/lake/types.d.ts.map +1 -0
  211. package/dist/lake/types.js +46 -0
  212. package/dist/lake/types.js.map +1 -0
  213. package/dist/lake/view-materializer.d.ts +70 -0
  214. package/dist/lake/view-materializer.d.ts.map +1 -0
  215. package/dist/lake/view-materializer.js +314 -0
  216. package/dist/lake/view-materializer.js.map +1 -0
  217. package/dist/lake/view-store.d.ts +57 -0
  218. package/dist/lake/view-store.d.ts.map +1 -0
  219. package/dist/lake/view-store.js +348 -0
  220. package/dist/lake/view-store.js.map +1 -0
  221. package/dist/parsers/tree-sitter/index.d.ts +1 -0
  222. package/dist/parsers/tree-sitter/index.d.ts.map +1 -1
  223. package/dist/parsers/tree-sitter/index.js +4 -0
  224. package/dist/parsers/tree-sitter/index.js.map +1 -1
  225. package/dist/parsers/tree-sitter/typescript-loader.d.ts +58 -0
  226. package/dist/parsers/tree-sitter/typescript-loader.d.ts.map +1 -0
  227. package/dist/parsers/tree-sitter/typescript-loader.js +250 -0
  228. package/dist/parsers/tree-sitter/typescript-loader.js.map +1 -0
  229. package/dist/store/project-config.d.ts +154 -0
  230. package/dist/store/project-config.d.ts.map +1 -0
  231. package/dist/store/project-config.js +235 -0
  232. package/dist/store/project-config.js.map +1 -0
  233. package/dist/store/project-registry.d.ts +241 -0
  234. package/dist/store/project-registry.d.ts.map +1 -0
  235. package/dist/store/project-registry.js +557 -0
  236. package/dist/store/project-registry.js.map +1 -0
  237. package/package.json +4 -2
@@ -0,0 +1,210 @@
1
+ /**
2
+ * Call Graph Store
3
+ *
4
+ * Persistence layer for the call graph.
5
+ * Stores and loads call graphs from .drift/call-graph/ directory.
6
+ */
7
+ import * as fs from 'node:fs/promises';
8
+ import * as path from 'node:path';
9
+ // ============================================================================
10
+ // Constants
11
+ // ============================================================================
12
+ const DRIFT_DIR = '.drift';
13
+ const CALL_GRAPH_DIR = 'call-graph';
14
+ const GRAPH_FILE = 'graph.json';
15
+ const REACHABILITY_CACHE_DIR = 'reachability-cache';
16
+ // ============================================================================
17
+ // Helper Functions
18
+ // ============================================================================
19
+ async function fileExists(filePath) {
20
+ try {
21
+ await fs.access(filePath);
22
+ return true;
23
+ }
24
+ catch {
25
+ return false;
26
+ }
27
+ }
28
+ async function ensureDir(dirPath) {
29
+ await fs.mkdir(dirPath, { recursive: true });
30
+ }
31
+ // ============================================================================
32
+ // Call Graph Store
33
+ // ============================================================================
34
+ /**
35
+ * Call Graph Store - Manages call graph persistence
36
+ */
37
+ export class CallGraphStore {
38
+ config;
39
+ callGraphDir;
40
+ cacheDir;
41
+ graph = null;
42
+ constructor(config) {
43
+ this.config = config;
44
+ this.callGraphDir = path.join(this.config.rootDir, DRIFT_DIR, CALL_GRAPH_DIR);
45
+ this.cacheDir = path.join(this.callGraphDir, REACHABILITY_CACHE_DIR);
46
+ }
47
+ /**
48
+ * Initialize the store
49
+ */
50
+ async initialize() {
51
+ await ensureDir(this.callGraphDir);
52
+ await ensureDir(this.cacheDir);
53
+ await this.load();
54
+ }
55
+ /**
56
+ * Load the call graph from disk
57
+ */
58
+ async load() {
59
+ const filePath = path.join(this.callGraphDir, GRAPH_FILE);
60
+ if (!(await fileExists(filePath))) {
61
+ this.graph = null;
62
+ return null;
63
+ }
64
+ try {
65
+ const content = await fs.readFile(filePath, 'utf-8');
66
+ const serialized = JSON.parse(content);
67
+ this.graph = this.deserialize(serialized);
68
+ return this.graph;
69
+ }
70
+ catch {
71
+ this.graph = null;
72
+ return null;
73
+ }
74
+ }
75
+ /**
76
+ * Save the call graph to disk
77
+ */
78
+ async save(graph) {
79
+ await ensureDir(this.callGraphDir);
80
+ const filePath = path.join(this.callGraphDir, GRAPH_FILE);
81
+ const serialized = this.serialize(graph);
82
+ await fs.writeFile(filePath, JSON.stringify(serialized, null, 2));
83
+ this.graph = graph;
84
+ // Clear reachability cache when graph changes
85
+ await this.clearCache();
86
+ }
87
+ /**
88
+ * Get the current call graph
89
+ */
90
+ getGraph() {
91
+ return this.graph;
92
+ }
93
+ /**
94
+ * Get a function by ID
95
+ */
96
+ getFunction(id) {
97
+ return this.graph?.functions.get(id);
98
+ }
99
+ /**
100
+ * Get functions in a file
101
+ */
102
+ getFunctionsInFile(file) {
103
+ if (!this.graph)
104
+ return [];
105
+ const functions = [];
106
+ for (const [, func] of this.graph.functions) {
107
+ if (func.file === file) {
108
+ functions.push(func);
109
+ }
110
+ }
111
+ return functions;
112
+ }
113
+ /**
114
+ * Get function at a specific line
115
+ */
116
+ getFunctionAtLine(file, line) {
117
+ if (!this.graph)
118
+ return null;
119
+ let best = null;
120
+ let bestSize = Infinity;
121
+ for (const [, func] of this.graph.functions) {
122
+ if (func.file === file && line >= func.startLine && line <= func.endLine) {
123
+ const size = func.endLine - func.startLine;
124
+ if (size < bestSize) {
125
+ best = func;
126
+ bestSize = size;
127
+ }
128
+ }
129
+ }
130
+ return best;
131
+ }
132
+ /**
133
+ * Cache a reachability result
134
+ */
135
+ async cacheReachability(key, data) {
136
+ const filePath = path.join(this.cacheDir, `${key}.json`);
137
+ await fs.writeFile(filePath, JSON.stringify(data));
138
+ }
139
+ /**
140
+ * Get a cached reachability result
141
+ */
142
+ async getCachedReachability(key) {
143
+ const filePath = path.join(this.cacheDir, `${key}.json`);
144
+ if (!(await fileExists(filePath))) {
145
+ return null;
146
+ }
147
+ try {
148
+ const content = await fs.readFile(filePath, 'utf-8');
149
+ return JSON.parse(content);
150
+ }
151
+ catch {
152
+ return null;
153
+ }
154
+ }
155
+ /**
156
+ * Clear the reachability cache
157
+ */
158
+ async clearCache() {
159
+ try {
160
+ const files = await fs.readdir(this.cacheDir);
161
+ await Promise.all(files.map((file) => fs.unlink(path.join(this.cacheDir, file))));
162
+ }
163
+ catch {
164
+ // Ignore errors
165
+ }
166
+ }
167
+ /**
168
+ * Serialize a call graph for storage
169
+ */
170
+ serialize(graph) {
171
+ const functions = {};
172
+ for (const [id, func] of graph.functions) {
173
+ functions[id] = func;
174
+ }
175
+ return {
176
+ version: graph.version,
177
+ generatedAt: graph.generatedAt,
178
+ projectRoot: graph.projectRoot,
179
+ functions,
180
+ entryPoints: graph.entryPoints,
181
+ dataAccessors: graph.dataAccessors,
182
+ stats: graph.stats,
183
+ };
184
+ }
185
+ /**
186
+ * Deserialize a call graph from storage
187
+ */
188
+ deserialize(serialized) {
189
+ const functions = new Map();
190
+ for (const [id, func] of Object.entries(serialized.functions)) {
191
+ functions.set(id, func);
192
+ }
193
+ return {
194
+ version: serialized.version,
195
+ generatedAt: serialized.generatedAt,
196
+ projectRoot: serialized.projectRoot,
197
+ functions,
198
+ entryPoints: serialized.entryPoints,
199
+ dataAccessors: serialized.dataAccessors,
200
+ stats: serialized.stats,
201
+ };
202
+ }
203
+ }
204
+ /**
205
+ * Create a new CallGraphStore instance
206
+ */
207
+ export function createCallGraphStore(config) {
208
+ return new CallGraphStore(config);
209
+ }
210
+ //# sourceMappingURL=call-graph-store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"call-graph-store.js","sourceRoot":"","sources":["../../../src/call-graph/store/call-graph-store.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC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,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,KAAK,CAAC,SAAS,EAAE,CAAC;YACzC,SAAS,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC;QACvB,CAAC;QAED,OAAO;YACL,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,WAAW,EAAE,KAAK,CAAC,WAAW;YAC9B,WAAW,EAAE,KAAK,CAAC,WAAW;YAC9B,SAAS;YACT,WAAW,EAAE,KAAK,CAAC,WAAW;YAC9B,aAAa,EAAE,KAAK,CAAC,aAAa;YAClC,KAAK,EAAE,KAAK,CAAC,KAAK;SACnB,CAAC;IACJ,CAAC;IAED;;OAEG;IACK,WAAW,CAAC,UAA+B;QACjD,MAAM,SAAS,GAAG,IAAI,GAAG,EAAwB,CAAC;QAClD,KAAK,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;YAC9D,SAAS,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;QAC1B,CAAC;QAED,OAAO;YACL,OAAO,EAAE,UAAU,CAAC,OAAO;YAC3B,WAAW,EAAE,UAAU,CAAC,WAAW;YACnC,WAAW,EAAE,UAAU,CAAC,WAAW;YACnC,SAAS;YACT,WAAW,EAAE,UAAU,CAAC,WAAW;YACnC,aAAa,EAAE,UAAU,CAAC,aAAa;YACvC,KAAK,EAAE,UAAU,CAAC,KAAK;SACxB,CAAC;IACJ,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAAC,MAA4B;IAC/D,OAAO,IAAI,cAAc,CAAC,MAAM,CAAC,CAAC;AACpC,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Call Graph Store
3
+ *
4
+ * Persistence layer for call graphs.
5
+ */
6
+ export { CallGraphStore, createCallGraphStore } from './call-graph-store.js';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/call-graph/store/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Call Graph Store
3
+ *
4
+ * Persistence layer for call graphs.
5
+ */
6
+ export { CallGraphStore, createCallGraphStore } from './call-graph-store.js';
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/call-graph/store/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,376 @@
1
+ /**
2
+ * Call Graph Types
3
+ *
4
+ * Core types for building and querying the call graph.
5
+ * Enables answering: "What data can this line of code ultimately access?"
6
+ */
7
+ import type { DataAccessPoint, SensitiveField } from '../boundaries/types.js';
8
+ /**
9
+ * Supported languages for call graph extraction
10
+ */
11
+ export type CallGraphLanguage = 'python' | 'typescript' | 'javascript' | 'java' | 'csharp' | 'php';
12
+ /**
13
+ * A function/method definition in the codebase
14
+ */
15
+ export interface FunctionNode {
16
+ /** Unique ID: "file:name:line" */
17
+ id: string;
18
+ /** Function/method name */
19
+ name: string;
20
+ /** Qualified name (Class.method or module.function) */
21
+ qualifiedName: string;
22
+ /** Source file path */
23
+ file: string;
24
+ /** Start line number */
25
+ startLine: number;
26
+ /** End line number */
27
+ endLine: number;
28
+ /** Language */
29
+ language: CallGraphLanguage;
30
+ /** What this function calls */
31
+ calls: CallSite[];
32
+ /** What calls this function (reverse edges) */
33
+ calledBy: CallSite[];
34
+ /** Direct data access within this function */
35
+ dataAccess: DataAccessPoint[];
36
+ /** Class name if this is a method */
37
+ className?: string | undefined;
38
+ /** Module/namespace name */
39
+ moduleName?: string | undefined;
40
+ /** Whether this is exported/public */
41
+ isExported: boolean;
42
+ /** Whether this is a constructor */
43
+ isConstructor: boolean;
44
+ /** Whether this is async */
45
+ isAsync: boolean;
46
+ /** Decorators/attributes (e.g., @app.route, [HttpGet]) */
47
+ decorators: string[];
48
+ /** Parameters */
49
+ parameters: ParameterInfo[];
50
+ /** Return type if known */
51
+ returnType?: string | undefined;
52
+ }
53
+ /**
54
+ * Parameter information
55
+ */
56
+ export interface ParameterInfo {
57
+ name: string;
58
+ type?: string | undefined;
59
+ hasDefault: boolean;
60
+ isRest: boolean;
61
+ }
62
+ /**
63
+ * A call site - where a function is called
64
+ */
65
+ export interface CallSite {
66
+ /** Function making the call */
67
+ callerId: string;
68
+ /** Function being called (if resolved) */
69
+ calleeId: string | null;
70
+ /** Name as it appears in code */
71
+ calleeName: string;
72
+ /** Receiver/object if method call (e.g., "user_service" in user_service.get_user()) */
73
+ receiver?: string | undefined;
74
+ /** Source file */
75
+ file: string;
76
+ /** Line number */
77
+ line: number;
78
+ /** Column number */
79
+ column: number;
80
+ /** Whether we could resolve the target */
81
+ resolved: boolean;
82
+ /** Multiple possible targets (polymorphism, dynamic dispatch) */
83
+ resolvedCandidates: string[];
84
+ /** Resolution confidence (0-1) */
85
+ confidence: number;
86
+ /** Why we resolved this way */
87
+ resolutionReason?: string | undefined;
88
+ /** Number of arguments */
89
+ argumentCount: number;
90
+ }
91
+ /**
92
+ * The complete call graph
93
+ */
94
+ export interface CallGraph {
95
+ /** Schema version */
96
+ version: '1.0';
97
+ /** Generation timestamp */
98
+ generatedAt: string;
99
+ /** Project root */
100
+ projectRoot: string;
101
+ /** All functions indexed by ID */
102
+ functions: Map<string, FunctionNode>;
103
+ /** Entry points (exported functions, API handlers, main) */
104
+ entryPoints: string[];
105
+ /** Functions with direct data access */
106
+ dataAccessors: string[];
107
+ /** Statistics */
108
+ stats: CallGraphStats;
109
+ }
110
+ /**
111
+ * Call graph statistics
112
+ */
113
+ export interface CallGraphStats {
114
+ totalFunctions: number;
115
+ totalCallSites: number;
116
+ resolvedCallSites: number;
117
+ unresolvedCallSites: number;
118
+ totalDataAccessors: number;
119
+ byLanguage: Record<CallGraphLanguage, number>;
120
+ }
121
+ /**
122
+ * Raw function extraction from parser
123
+ */
124
+ export interface FunctionExtraction {
125
+ name: string;
126
+ qualifiedName: string;
127
+ startLine: number;
128
+ endLine: number;
129
+ startColumn: number;
130
+ endColumn: number;
131
+ parameters: ParameterInfo[];
132
+ returnType?: string | undefined;
133
+ isMethod: boolean;
134
+ isStatic: boolean;
135
+ isExported: boolean;
136
+ isConstructor: boolean;
137
+ isAsync: boolean;
138
+ className?: string | undefined;
139
+ moduleName?: string | undefined;
140
+ decorators: string[];
141
+ /** Raw body text for further analysis */
142
+ bodyStartLine: number;
143
+ bodyEndLine: number;
144
+ }
145
+ /**
146
+ * Raw call extraction from parser
147
+ */
148
+ export interface CallExtraction {
149
+ /** What's being called */
150
+ calleeName: string;
151
+ /** Object/class it's called on */
152
+ receiver?: string | undefined;
153
+ /** Full expression (e.g., "self.service.get_user") */
154
+ fullExpression: string;
155
+ /** Line number */
156
+ line: number;
157
+ /** Column number */
158
+ column: number;
159
+ /** Argument count for overload resolution */
160
+ argumentCount: number;
161
+ /** Whether this is a method call vs function call */
162
+ isMethodCall: boolean;
163
+ /** Whether this is a constructor call (new Foo()) */
164
+ isConstructorCall: boolean;
165
+ }
166
+ /**
167
+ * Result of extracting from a single file
168
+ */
169
+ export interface FileExtractionResult {
170
+ file: string;
171
+ language: CallGraphLanguage;
172
+ functions: FunctionExtraction[];
173
+ calls: CallExtraction[];
174
+ imports: ImportExtraction[];
175
+ exports: ExportExtraction[];
176
+ classes: ClassExtraction[];
177
+ errors: string[];
178
+ }
179
+ /**
180
+ * Import extraction
181
+ */
182
+ export interface ImportExtraction {
183
+ /** Source module/file */
184
+ source: string;
185
+ /** Imported names */
186
+ names: ImportedName[];
187
+ /** Line number */
188
+ line: number;
189
+ /** Is this a type-only import */
190
+ isTypeOnly: boolean;
191
+ }
192
+ /**
193
+ * Individual imported name
194
+ */
195
+ export interface ImportedName {
196
+ /** Name as exported */
197
+ imported: string;
198
+ /** Local alias */
199
+ local: string;
200
+ /** Is default import */
201
+ isDefault: boolean;
202
+ /** Is namespace import (import * as foo) */
203
+ isNamespace: boolean;
204
+ }
205
+ /**
206
+ * Export extraction
207
+ */
208
+ export interface ExportExtraction {
209
+ name: string;
210
+ isDefault: boolean;
211
+ isReExport: boolean;
212
+ source?: string | undefined;
213
+ line: number;
214
+ }
215
+ /**
216
+ * Class extraction
217
+ */
218
+ export interface ClassExtraction {
219
+ name: string;
220
+ startLine: number;
221
+ endLine: number;
222
+ baseClasses: string[];
223
+ methods: string[];
224
+ isExported: boolean;
225
+ }
226
+ /**
227
+ * Context for resolving calls
228
+ */
229
+ export interface ResolutionContext {
230
+ /** Imports in the current file */
231
+ imports: ImportExtraction[];
232
+ /** All known functions */
233
+ allFunctions: Map<string, FunctionNode>;
234
+ /** All known classes */
235
+ allClasses: Map<string, ClassExtraction>;
236
+ /** File being resolved */
237
+ currentFile: string;
238
+ /** Project root for path resolution */
239
+ projectRoot: string;
240
+ }
241
+ /**
242
+ * Result of resolving a call
243
+ */
244
+ export interface ResolvedCall {
245
+ resolved: boolean;
246
+ /** Function IDs that could be the target */
247
+ candidates: string[];
248
+ /** Confidence score (0-1) */
249
+ confidence: number;
250
+ /** Why we resolved this way */
251
+ reason: string;
252
+ }
253
+ /**
254
+ * Result of reachability analysis
255
+ */
256
+ export interface ReachabilityResult {
257
+ /** Starting point */
258
+ origin: CodeLocation;
259
+ /** All reachable data access */
260
+ reachableAccess: ReachableDataAccess[];
261
+ /** Summary: tables that can be reached */
262
+ tables: string[];
263
+ /** Summary: sensitive fields that can be reached */
264
+ sensitiveFields: SensitiveFieldAccess[];
265
+ /** Maximum call depth to reach data */
266
+ maxDepth: number;
267
+ /** Total functions traversed */
268
+ functionsTraversed: number;
269
+ }
270
+ /**
271
+ * A code location
272
+ */
273
+ export interface CodeLocation {
274
+ file: string;
275
+ line: number;
276
+ column?: number;
277
+ functionId?: string;
278
+ }
279
+ /**
280
+ * A reachable data access point with path
281
+ */
282
+ export interface ReachableDataAccess {
283
+ /** The actual data access */
284
+ access: DataAccessPoint;
285
+ /** Call path to reach this access */
286
+ path: CallPathNode[];
287
+ /** Depth in call graph */
288
+ depth: number;
289
+ }
290
+ /**
291
+ * A node in a call path
292
+ */
293
+ export interface CallPathNode {
294
+ functionId: string;
295
+ functionName: string;
296
+ file: string;
297
+ line: number;
298
+ }
299
+ /**
300
+ * Sensitive field access info
301
+ */
302
+ export interface SensitiveFieldAccess {
303
+ field: SensitiveField;
304
+ paths: CallPathNode[][];
305
+ accessCount: number;
306
+ }
307
+ /**
308
+ * Serializable call graph for storage
309
+ */
310
+ export interface SerializedCallGraph {
311
+ version: '1.0';
312
+ generatedAt: string;
313
+ projectRoot: string;
314
+ functions: Record<string, FunctionNode>;
315
+ entryPoints: string[];
316
+ dataAccessors: string[];
317
+ stats: CallGraphStats;
318
+ }
319
+ /**
320
+ * Call graph store configuration
321
+ */
322
+ export interface CallGraphStoreConfig {
323
+ rootDir: string;
324
+ }
325
+ /**
326
+ * Options for reachability queries
327
+ */
328
+ export interface ReachabilityOptions {
329
+ /** Maximum depth to traverse (default: unlimited) */
330
+ maxDepth?: number;
331
+ /** Only include paths to sensitive data */
332
+ sensitiveOnly?: boolean;
333
+ /** Filter by table names */
334
+ tables?: string[];
335
+ /** Include unresolved calls in traversal */
336
+ includeUnresolved?: boolean;
337
+ }
338
+ /**
339
+ * Options for inverse queries ("who can reach this data?")
340
+ */
341
+ export interface InverseReachabilityOptions {
342
+ /** Table to query */
343
+ table: string;
344
+ /** Specific field (optional) */
345
+ field?: string;
346
+ /** Maximum depth */
347
+ maxDepth?: number;
348
+ }
349
+ /**
350
+ * Result of inverse reachability query
351
+ */
352
+ export interface InverseReachabilityResult {
353
+ /** The data being queried */
354
+ target: {
355
+ table: string;
356
+ field?: string | undefined;
357
+ };
358
+ /** All code paths that can reach this data */
359
+ accessPaths: InverseAccessPath[];
360
+ /** Entry points that can reach this data */
361
+ entryPoints: string[];
362
+ /** Total unique functions that can access */
363
+ totalAccessors: number;
364
+ }
365
+ /**
366
+ * A path from entry point to data access
367
+ */
368
+ export interface InverseAccessPath {
369
+ /** Entry point function */
370
+ entryPoint: string;
371
+ /** Path to data access */
372
+ path: CallPathNode[];
373
+ /** The access point */
374
+ accessPoint: DataAccessPoint;
375
+ }
376
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/call-graph/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAM9E;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,YAAY,GAAG,YAAY,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;AAEnG;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,kCAAkC;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,2BAA2B;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,uDAAuD;IACvD,aAAa,EAAE,MAAM,CAAC;IACtB,uBAAuB;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,wBAAwB;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,sBAAsB;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe;IACf,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,+BAA+B;IAC/B,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,+CAA+C;IAC/C,QAAQ,EAAE,QAAQ,EAAE,CAAC;IACrB,8CAA8C;IAC9C,UAAU,EAAE,eAAe,EAAE,CAAC;IAC9B,qCAAqC;IACrC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,4BAA4B;IAC5B,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,sCAAsC;IACtC,UAAU,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ACxB,4BAA4B;IAC5B,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,4CAA4C;IAC5C,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,qBAAqB;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,gCAAgC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oBAAoB;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,6BAA6B;IAC7B,MAAM,EAAE;QACN,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;KAC5B,CAAC;IACF,8CAA8C;IAC9C,WAAW,EAAE,iBAAiB,EAAE,CAAC;IACjC,4CAA4C;IAC5C,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,6CAA6C;IAC7C,cAAc,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,2BAA2B;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,0BAA0B;IAC1B,IAAI,EAAE,YAAY,EAAE,CAAC;IACrB,uBAAuB;IACvB,WAAW,EAAE,eAAe,CAAC;CAC9B"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Call Graph Types
3
+ *
4
+ * Core types for building and querying the call graph.
5
+ * Enables answering: "What data can this line of code ultimately access?"
6
+ */
7
+ export {};
8
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/call-graph/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
package/dist/index.d.ts CHANGED
@@ -31,6 +31,10 @@ export type { PatternFile, StoredPattern, DetectorConfig, ConfidenceInfo, Patter
31
31
  export { CacheManager } from './store/cache-manager.js';
32
32
  export type { CacheManagerOptions, CacheEntry, CacheStats } from './store/cache-manager.js';
33
33
  export { PatternStore, PatternNotFoundError, InvalidStateTransitionError, PatternStoreError } from './store/pattern-store.js';
34
+ export { ProjectRegistry, getProjectRegistry, createProjectRegistry, } from './store/project-registry.js';
35
+ export type { RegisteredProject, ProjectRegistryFile, ProjectRegistryConfig, ProjectRegistrationOptions, ProjectFramework, ProjectLanguage, ProjectHealth, RegistryEventType, RegistryEvent, } from './store/project-registry.js';
36
+ export { ProjectConfigManager, createProjectConfigManager, loadProjectConfig, createDefaultConfig, } from './store/project-config.js';
37
+ export type { ProjectConfig, ProjectMetadata, CIConfig, LearningConfig, PerformanceConfig, LegacyConfig, } from './store/project-config.js';
34
38
  export { HistoryStore } from './store/history-store.js';
35
39
  export type { PatternSnapshot, HistorySnapshot, PatternTrend, TrendSummary, CategorySummary, HistoryStoreConfig } from './store/history-store.js';
36
40
  export * from './types/contracts.js';
@@ -45,4 +49,8 @@ export * from './manifest/index.js';
45
49
  export * from './learning/index.js';
46
50
  export * from './dna/index.js';
47
51
  export * from './boundaries/index.js';
52
+ export * from './lake/index.js';
53
+ export { CallGraphAnalyzer, createCallGraphAnalyzer, BaseCallGraphExtractor, TypeScriptCallGraphExtractor, PythonCallGraphExtractor, CSharpCallGraphExtractor, JavaCallGraphExtractor, PhpCallGraphExtractor, GraphBuilder, ReachabilityEngine, CallGraphStore, createCallGraphStore, ImpactAnalyzer, createImpactAnalyzer, DeadCodeDetector, createDeadCodeDetector, CoverageAnalyzer, createCoverageAnalyzer, BaseDataAccessExtractor, TypeScriptDataAccessExtractor, createTypeScriptDataAccessExtractor, PythonDataAccessExtractor, createPythonDataAccessExtractor, createDataAccessExtractors, SemanticDataAccessScanner, createSemanticDataAccessScanner, detectProjectStack, } from './call-graph/index.js';
54
+ export type { SemanticScannerConfig, SemanticScanResult, DetectedStack, } from './call-graph/index.js';
55
+ export type { CallGraph, CallGraphLanguage, FunctionNode, CallSite, CallGraphStats, FileExtractionResult, FunctionExtraction, CallExtraction, ImportExtraction as CallGraphImportExtraction, ExportExtraction, ClassExtraction as CallGraphClassExtraction, ReachabilityResult, ReachabilityOptions, ReachableDataAccess, CallPathNode, CodeLocation, SensitiveFieldAccess, InverseReachabilityOptions, InverseReachabilityResult, InverseAccessPath, SerializedCallGraph, CallGraphStoreConfig, CallGraphAnalyzerConfig, ParameterInfo as CallGraphParameterInfo, PriorityTier, DataRegulation, ImpactRisk, AffectedFunction, AffectedDataPath, ImpactAnalysisResult, ImpactAnalysisOptions, DeadCodeConfidence, FalsePositiveReason, DeadCodeCandidate, DeadCodeResult, DeadCodeOptions, CoverageStatus, SensitiveAccessPath, FieldCoverage, CoverageAnalysisResult, CoverageAnalysisOptions, SensitivityPatternConfig, DataAccessExtractionResult, } from './call-graph/index.js';
48
56
  //# sourceMappingURL=index.d.ts.map