@proxysoul/soulforge 1.7.0 → 1.7.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.
@@ -24425,13 +24425,16 @@ class RepoMap {
24425
24425
  });
24426
24426
  }
24427
24427
  const stale = [...existingFiles.keys()].filter((p2) => !currentPaths.has(p2));
24428
- if (stale.length > 0) {
24428
+ const staleRatio = existingFiles.size > 0 ? stale.length / existingFiles.size : 0;
24429
+ if (stale.length > 0 && staleRatio < 0.8) {
24429
24430
  const deleteFile = this.db.prepare("DELETE FROM files WHERE path = ?");
24430
24431
  const tx = this.db.transaction(() => {
24431
24432
  for (const p2 of stale)
24432
24433
  deleteFile.run(p2);
24433
24434
  });
24434
24435
  tx();
24436
+ } else if (stale.length > 0) {
24437
+ this.onError?.(`Skipped removing ${String(stale.length)} files \u2014 looks like a file listing error (${String(Math.round(staleRatio * 100))}% stale). Use /repo-map \u2192 [X] clear to force.`);
24435
24438
  }
24436
24439
  if (toIndex.length > 0) {
24437
24440
  this.onProgress?.(0, toIndex.length);
@@ -24456,7 +24459,8 @@ class RepoMap {
24456
24459
  this.onProgress?.(toIndex.length, toIndex.length);
24457
24460
  }
24458
24461
  const edgeCount = this.db.query("SELECT COUNT(*) as c FROM edges").get()?.c ?? 0;
24459
- const needsPostIndexing = toIndex.length > 0 || stale.length > 0 || edgeCount === 0;
24462
+ const fileCount = this.db.query("SELECT COUNT(*) as c FROM files").get()?.c ?? 0;
24463
+ const needsPostIndexing = toIndex.length > 0 || stale.length > 0 || fileCount > 0 && edgeCount === 0;
24460
24464
  if (needsPostIndexing) {
24461
24465
  this.onProgress?.(-1, -1);
24462
24466
  await tick();
@@ -272838,14 +272842,8 @@ ctx = createWorkerHandler(handlers, async (config) => {
272838
272842
  if (typeof config.maxFiles === "number" && config.maxFiles > 0) {
272839
272843
  repoMap.maxFiles = config.maxFiles;
272840
272844
  }
272841
- let lastStats = {
272842
- files: 0,
272843
- symbols: 0,
272844
- edges: 0,
272845
- summaries: 0,
272846
- calls: 0
272847
- };
272848
- let lastDbSize = 0;
272845
+ let lastStats = repoMap.getStats();
272846
+ let lastDbSize = repoMap.dbSizeBytes();
272849
272847
  repoMap.onProgress = (indexed, total) => {
272850
272848
  const rm = repoMap;
272851
272849
  if (!rm)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proxysoul/soulforge",
3
- "version": "1.7.0",
3
+ "version": "1.7.2",
4
4
  "description": "Graph-powered code intelligence — multi-agent coding with codebase-aware AI",
5
5
  "repository": {
6
6
  "type": "git",