MCPcopy Index your code
hub / github.com/PatrickSys/codebase-context / computeIndexConfidence

Function computeIndexConfidence

src/tools/search-codebase.ts:387–399  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

385 .map((entry) => entry.memory);
386
387 function computeIndexConfidence(): 'fresh' | 'aging' | 'stale' {
388 let confidence: 'fresh' | 'aging' | 'stale' = 'stale';
389 if (intelligence?.generatedAt) {
390 const indexAge = Date.now() - new Date(intelligence.generatedAt).getTime();
391 const hoursOld = indexAge / (1000 * 60 * 60);
392 if (hoursOld < 24) {
393 confidence = 'fresh';
394 } else if (hoursOld < 168) {
395 confidence = 'aging';
396 }
397 }
398 return confidence;
399 }
400
401 type ImpactCandidate = { file: string; line?: number; hop: 1 | 2 };
402

Callers 1

handleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected