@pratik7368patil/anchor-core 0.1.7 → 0.1.9

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.7",
3
+ "version": "0.1.9",
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,10 +116,70 @@ 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 test_files (
120
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
121
+ repo_id INTEGER NOT NULL REFERENCES repositories(id) ON DELETE CASCADE,
122
+ path TEXT NOT NULL,
123
+ language TEXT,
124
+ size_bytes INTEGER NOT NULL,
125
+ content_hash TEXT NOT NULL,
126
+ updated_at TEXT NOT NULL,
127
+ UNIQUE(repo_id, path)
128
+ );
129
+
130
+ CREATE TABLE IF NOT EXISTS test_links (
131
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
132
+ repo_id INTEGER NOT NULL REFERENCES repositories(id) ON DELETE CASCADE,
133
+ source_path TEXT NOT NULL,
134
+ test_path TEXT NOT NULL,
135
+ reason TEXT NOT NULL,
136
+ strength REAL NOT NULL,
137
+ UNIQUE(repo_id, source_path, test_path, reason)
138
+ );
139
+
140
+ CREATE TABLE IF NOT EXISTS regression_events (
141
+ id TEXT PRIMARY KEY,
142
+ repo_id INTEGER NOT NULL REFERENCES repositories(id) ON DELETE CASCADE,
143
+ pr_id INTEGER REFERENCES pull_requests(id) ON DELETE CASCADE,
144
+ repo TEXT NOT NULL,
145
+ pr_number INTEGER NOT NULL,
146
+ pr_url TEXT NOT NULL,
147
+ summary_sanitized TEXT NOT NULL,
148
+ file_paths_json TEXT NOT NULL,
149
+ symbols_json TEXT NOT NULL,
150
+ test_paths_json TEXT NOT NULL,
151
+ authors_json TEXT NOT NULL,
152
+ labels_json TEXT NOT NULL,
153
+ signals_json TEXT NOT NULL,
154
+ created_at TEXT NOT NULL,
155
+ merged_at TEXT,
156
+ confidence REAL NOT NULL
157
+ );
158
+
159
+ CREATE TABLE IF NOT EXISTS index_runs (
160
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
161
+ command TEXT NOT NULL,
162
+ repo TEXT,
163
+ started_at TEXT NOT NULL,
164
+ finished_at TEXT,
165
+ history_coverage TEXT,
166
+ history_limit INTEGER,
167
+ prs_fetched INTEGER,
168
+ prs_skipped INTEGER,
169
+ comments_indexed INTEGER,
170
+ code_files_indexed INTEGER,
171
+ test_files_indexed INTEGER,
172
+ failures_json TEXT NOT NULL DEFAULT '[]',
173
+ status TEXT NOT NULL
174
+ );
175
+
119
176
  CREATE TABLE IF NOT EXISTS sync_state (
120
177
  repo TEXT PRIMARY KEY,
121
178
  last_sync_at TEXT,
122
179
  last_indexed_pr INTEGER,
180
+ history_coverage TEXT,
181
+ history_limit INTEGER,
182
+ history_since TEXT,
123
183
  updated_at TEXT NOT NULL
124
184
  );
125
185
 
@@ -130,3 +190,8 @@ CREATE INDEX IF NOT EXISTS idx_wisdom_units_category ON wisdom_units(category);
130
190
  CREATE INDEX IF NOT EXISTS idx_wisdom_units_pr ON wisdom_units(pr_id);
131
191
  CREATE INDEX IF NOT EXISTS idx_code_files_path ON code_files(path);
132
192
  CREATE INDEX IF NOT EXISTS idx_code_chunks_file_path ON code_chunks(file_path);
193
+ CREATE INDEX IF NOT EXISTS idx_test_files_path ON test_files(path);
194
+ CREATE INDEX IF NOT EXISTS idx_test_links_source ON test_links(source_path);
195
+ CREATE INDEX IF NOT EXISTS idx_test_links_test ON test_links(test_path);
196
+ CREATE INDEX IF NOT EXISTS idx_regression_events_pr ON regression_events(pr_id);
197
+ CREATE INDEX IF NOT EXISTS idx_index_runs_started ON index_runs(started_at);