(memory: MemoryWithConfidence)
| 337 | ); |
| 338 | |
| 339 | function getMemoryScopeBoost(memory: MemoryWithConfidence): number { |
| 340 | if (!memory.scope || memory.scope.kind === 'global') return 0; |
| 341 | |
| 342 | const normalizedFile = normalizeGraphPath(memory.scope.file); |
| 343 | if (memory.scope.kind === 'file') { |
| 344 | return resultPathSet.has(normalizedFile) ? 3 : 0; |
| 345 | } |
| 346 | |
| 347 | const symbolMatch = |
| 348 | resultSymbolSet.has(normalizeSymbolName(memory.scope.symbol)) || |
| 349 | queryTermSet.has(normalizeSymbolName(memory.scope.symbol)); |
| 350 | |
| 351 | if (resultPathSet.has(normalizedFile) && symbolMatch) return 4; |
| 352 | if (resultPathSet.has(normalizedFile)) return 2; |
| 353 | if (symbolMatch) return 1; |
| 354 | return 0; |
| 355 | } |
| 356 | |
| 357 | function getMemoryTextMatchCount(memory: MemoryWithConfidence): number { |
| 358 | const haystack = |
no test coverage detected