@pratik7368patil/anchor-core 0.1.11 → 0.1.13

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pratik7368patil/anchor-core",
3
- "version": "0.1.11",
3
+ "version": "0.1.13",
4
4
  "description": "Core local indexing, sanitization, and retrieval engine for Anchor.",
5
5
  "license": "MIT",
6
6
  "type": "module",
package/src/db/schema.sql CHANGED
@@ -116,6 +116,61 @@ CREATE TABLE IF NOT EXISTS code_index_state (
116
116
  skipped_files INTEGER NOT NULL
117
117
  );
118
118
 
119
+ CREATE TABLE IF NOT EXISTS code_imports (
120
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
121
+ repo_id INTEGER NOT NULL REFERENCES repositories(id) ON DELETE CASCADE,
122
+ source_path TEXT NOT NULL,
123
+ specifier TEXT NOT NULL,
124
+ imported_path TEXT,
125
+ imported_symbols_json TEXT NOT NULL,
126
+ kind TEXT NOT NULL
127
+ );
128
+
129
+ CREATE TABLE IF NOT EXISTS architecture_components (
130
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
131
+ repo_id INTEGER NOT NULL REFERENCES repositories(id) ON DELETE CASCADE,
132
+ path TEXT NOT NULL,
133
+ area TEXT NOT NULL,
134
+ kind TEXT NOT NULL,
135
+ language TEXT,
136
+ symbols_json TEXT NOT NULL,
137
+ imports_json TEXT NOT NULL,
138
+ related_tests_json TEXT NOT NULL,
139
+ confidence REAL NOT NULL,
140
+ updated_at TEXT NOT NULL,
141
+ UNIQUE(repo_id, path)
142
+ );
143
+
144
+ CREATE TABLE IF NOT EXISTS architecture_patterns (
145
+ id TEXT PRIMARY KEY,
146
+ repo_id INTEGER NOT NULL REFERENCES repositories(id) ON DELETE CASCADE,
147
+ repo TEXT NOT NULL,
148
+ area TEXT NOT NULL,
149
+ name TEXT NOT NULL,
150
+ summary_sanitized TEXT NOT NULL,
151
+ source_files_json TEXT NOT NULL,
152
+ symbols_json TEXT NOT NULL,
153
+ evidence_json TEXT NOT NULL,
154
+ confidence REAL NOT NULL,
155
+ created_at TEXT NOT NULL
156
+ );
157
+
158
+ CREATE VIRTUAL TABLE IF NOT EXISTS architecture_patterns_fts USING fts5(
159
+ patternId UNINDEXED,
160
+ summary,
161
+ area,
162
+ sourceFiles,
163
+ symbols
164
+ );
165
+
166
+ CREATE TABLE IF NOT EXISTS architecture_index_state (
167
+ repo TEXT PRIMARY KEY,
168
+ last_indexed_at TEXT NOT NULL,
169
+ components INTEGER NOT NULL,
170
+ patterns INTEGER NOT NULL,
171
+ imports INTEGER NOT NULL
172
+ );
173
+
119
174
  CREATE TABLE IF NOT EXISTS test_files (
120
175
  id INTEGER PRIMARY KEY AUTOINCREMENT,
121
176
  repo_id INTEGER NOT NULL REFERENCES repositories(id) ON DELETE CASCADE,
@@ -190,6 +245,11 @@ CREATE INDEX IF NOT EXISTS idx_wisdom_units_category ON wisdom_units(category);
190
245
  CREATE INDEX IF NOT EXISTS idx_wisdom_units_pr ON wisdom_units(pr_id);
191
246
  CREATE INDEX IF NOT EXISTS idx_code_files_path ON code_files(path);
192
247
  CREATE INDEX IF NOT EXISTS idx_code_chunks_file_path ON code_chunks(file_path);
248
+ CREATE INDEX IF NOT EXISTS idx_code_imports_source ON code_imports(source_path);
249
+ CREATE INDEX IF NOT EXISTS idx_code_imports_imported ON code_imports(imported_path);
250
+ CREATE INDEX IF NOT EXISTS idx_architecture_components_path ON architecture_components(path);
251
+ CREATE INDEX IF NOT EXISTS idx_architecture_components_area ON architecture_components(area);
252
+ CREATE INDEX IF NOT EXISTS idx_architecture_patterns_area ON architecture_patterns(area);
193
253
  CREATE INDEX IF NOT EXISTS idx_test_files_path ON test_files(path);
194
254
  CREATE INDEX IF NOT EXISTS idx_test_links_source ON test_links(source_path);
195
255
  CREATE INDEX IF NOT EXISTS idx_test_links_test ON test_links(test_path);