raggrep 0.10.7 → 0.10.8

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.
@@ -48,6 +48,13 @@ export interface TimingInfo {
48
48
  filesReindexed: number;
49
49
  /** Whether result was from cache */
50
50
  fromCache: boolean;
51
+ /** Diagnostic: breakdown of why files went to Phase 2 */
52
+ phase2Reasons?: {
53
+ newFiles: number;
54
+ noFileSize: number;
55
+ sizeMismatch: number;
56
+ noContentHash: number;
57
+ };
51
58
  }
52
59
  export interface EnsureFreshResult {
53
60
  /** Number of files indexed (new or modified) */
package/dist/cli/main.js CHANGED
@@ -12059,6 +12059,10 @@ async function ensureIndexFresh(rootDir, options = {}) {
12059
12059
  let filesStatChecked = 0;
12060
12060
  let filesWithChanges = 0;
12061
12061
  let filesReindexed = 0;
12062
+ let totalDiagNewFiles = 0;
12063
+ let totalDiagNoFileSize = 0;
12064
+ let totalDiagSizeMismatch = 0;
12065
+ let totalDiagNoContentHash = 0;
12062
12066
  const logger = options.logger ? options.logger : quiet ? createSilentLogger() : createLogger({ verbose });
12063
12067
  rootDir = path22.resolve(rootDir);
12064
12068
  const status = await getIndexStatus(rootDir);
@@ -12212,18 +12216,36 @@ async function ensureIndexFresh(rootDir, options = {}) {
12212
12216
  return null;
12213
12217
  }
12214
12218
  };
12219
+ const moduleFiles = module2.supportsFile ? currentFiles.filter((f) => module2.supportsFile(f)) : currentFiles;
12215
12220
  const statCheckStart = Date.now();
12216
- const statResults = await parallelMap(currentFiles, statCheck, STAT_CONCURRENCY);
12221
+ const statResults = await parallelMap(moduleFiles, statCheck, STAT_CONCURRENCY);
12217
12222
  statCheckMs += Date.now() - statCheckStart;
12218
- filesStatChecked += currentFiles.length;
12223
+ filesStatChecked += moduleFiles.length;
12219
12224
  const filesToProcess = [];
12220
12225
  const filesWithMtimeOnlyChange = [];
12221
12226
  let unchangedCount = 0;
12227
+ let diagNewFiles = 0;
12228
+ let diagNoFileSize = 0;
12229
+ let diagSizeMismatch = 0;
12230
+ let diagNoContentHash = 0;
12222
12231
  for (const result2 of statResults) {
12223
12232
  if (!result2.success || !result2.value)
12224
12233
  continue;
12225
12234
  if (result2.value.needsCheck) {
12226
12235
  filesToProcess.push(result2.value);
12236
+ if (result2.value.isNew) {
12237
+ diagNewFiles++;
12238
+ } else {
12239
+ const existingEntry = manifest.files[result2.value.relativePath];
12240
+ if (existingEntry) {
12241
+ if (existingEntry.fileSize === undefined)
12242
+ diagNoFileSize++;
12243
+ else if (existingEntry.fileSize !== result2.value.fileSize)
12244
+ diagSizeMismatch++;
12245
+ else if (!existingEntry.contentHash)
12246
+ diagNoContentHash++;
12247
+ }
12248
+ }
12227
12249
  } else {
12228
12250
  unchangedCount++;
12229
12251
  const existingEntry = manifest.files[result2.value.relativePath];
@@ -12232,6 +12254,13 @@ async function ensureIndexFresh(rootDir, options = {}) {
12232
12254
  }
12233
12255
  }
12234
12256
  }
12257
+ totalDiagNewFiles += diagNewFiles;
12258
+ totalDiagNoFileSize += diagNoFileSize;
12259
+ totalDiagSizeMismatch += diagSizeMismatch;
12260
+ totalDiagNoContentHash += diagNoContentHash;
12261
+ if (filesToProcess.length > 100 && verbose) {
12262
+ logger.info(` [Diagnostic] Phase 2 reasons: new=${diagNewFiles}, noSize=${diagNoFileSize}, sizeMismatch=${diagSizeMismatch}, noHash=${diagNoContentHash}`);
12263
+ }
12235
12264
  let mtimeOnlyUpdates = 0;
12236
12265
  for (const file of filesWithMtimeOnlyChange) {
12237
12266
  const existingEntry = manifest.files[file.relativePath];
@@ -12370,7 +12399,13 @@ async function ensureIndexFresh(rootDir, options = {}) {
12370
12399
  filesStatChecked,
12371
12400
  filesWithChanges,
12372
12401
  filesReindexed: totalIndexed,
12373
- fromCache: false
12402
+ fromCache: false,
12403
+ phase2Reasons: {
12404
+ newFiles: totalDiagNewFiles,
12405
+ noFileSize: totalDiagNoFileSize,
12406
+ sizeMismatch: totalDiagSizeMismatch,
12407
+ noContentHash: totalDiagNoContentHash
12408
+ }
12374
12409
  };
12375
12410
  }
12376
12411
  let finalManifestMtime = currentManifestMtime;
@@ -14284,7 +14319,7 @@ init_logger();
14284
14319
  // package.json
14285
14320
  var package_default = {
14286
14321
  name: "raggrep",
14287
- version: "0.10.7",
14322
+ version: "0.10.8",
14288
14323
  description: "Local filesystem-based RAG system for codebases - semantic search using local embeddings",
14289
14324
  type: "module",
14290
14325
  main: "./dist/index.js",
@@ -14640,6 +14675,15 @@ Examples:
14640
14675
  console.log(`│ Cleanup: ${t.cleanupMs.toFixed(0).padStart(6)}ms │`.padEnd(57) + "│");
14641
14676
  console.log(`│ ───────────────────────────────────────────────────── │`);
14642
14677
  console.log(`│ Total: ${t.totalMs.toFixed(0).padStart(6)}ms`.padEnd(57) + "│");
14678
+ if (t.phase2Reasons && t.filesWithChanges > 0) {
14679
+ const r = t.phase2Reasons;
14680
+ console.log(`│ ───────────────────────────────────────────────────── │`);
14681
+ console.log(`│ Phase 2 breakdown (why files needed verification): │`);
14682
+ console.log(`│ New files: ${String(r.newFiles).padStart(6)}`.padEnd(57) + "│");
14683
+ console.log(`│ No cached size: ${String(r.noFileSize).padStart(6)}`.padEnd(57) + "│");
14684
+ console.log(`│ Size mismatch: ${String(r.sizeMismatch).padStart(6)}`.padEnd(57) + "│");
14685
+ console.log(`│ No cached hash: ${String(r.noContentHash).padStart(6)}`.padEnd(57) + "│");
14686
+ }
14643
14687
  }
14644
14688
  console.log(`└────────────────────────────────────────────────────────┘
14645
14689
  `);
@@ -14901,4 +14945,4 @@ Run 'raggrep <command> --help' for more information.
14901
14945
  }
14902
14946
  main();
14903
14947
 
14904
- //# debugId=FECC7BE122B3EB1664756E2164756E21
14948
+ //# debugId=BAC395AB000714B764756E2164756E21