Skip to content

Commit c02d11d

Browse files
committed
refactor(memory-search): drop explanatory comments from hybrid fusion
The dropMediaTextSignal name and the regression coverage in hybrid.test.ts already describe each gating condition, so the block comments added no information the code did not carry. No logic change.
1 parent 5cce9c6 commit c02d11d

1 file changed

Lines changed: 0 additions & 12 deletions

File tree

extensions/memory-core/src/memory/hybrid.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -182,23 +182,11 @@ export async function mergeHybridResults(params: {
182182
: entry.exactPathSpecificity > 0
183183
? 0
184184
: entry.pathScore;
185-
// Make fusion modality-aware: non-text media (image/audio) only carries a
186-
// synthetic label as text, so its keyword signal is structurally near zero.
187-
// For such candidates drop the text weight and renormalize by the remaining
188-
// vector weight so the score collapses to the vector signal on the same
189-
// [0,1] scale as text candidates. Only drop the signal when the candidate
190-
// has a vector signal but no keyword signal, so a keyword-only or both-signal
191-
// media hit keeps its text-weighted score. Gate the drop on a positive
192-
// configured vector weight so a valid keyword match is never removed when
193-
// vectorWeight is 0.
194185
const dropMediaTextSignal =
195186
entry.hasVector &&
196187
!entry.hasKeyword &&
197188
params.vectorWeight > 0 &&
198189
params.isNonTextMediaPath?.(entry.path) === true;
199-
// Renormalize only for the vector-only media case. Every other candidate
200-
// keeps the established unnormalized weighted formula, so custom weights
201-
// that do not sum to one preserve their score scale and result ordering.
202190
const contentScore = dropMediaTextSignal
203191
? entry.vectorScore
204192
: params.vectorWeight * entry.vectorScore + params.textWeight * keywordScore;

0 commit comments

Comments
 (0)