fix: skip applyRecencyBoost when decayEngine is active in vectorOnlyRetrieval#500
fix: skip applyRecencyBoost when decayEngine is active in vectorOnlyRetrieval#500jlin53882 wants to merge 2 commits intoCortexReach:masterfrom
Conversation
…ieval Bug 7 fix: when decayEngine is active, skip applyRecencyBoost here because decayEngine already handles temporal scoring; avoid double-boost.
Review: fix: skip applyRecencyBoost when decayEngine is active in vectorOnlyRetrievalCorrect fix — hybrid and BM25 paths already skip legacy recency when decayEngine is active, vector-only was the remaining inconsistency. Must FixNo regression test for the fixed behavior. The vector-only + decayEngine branch is not exercised by any existing test. Add one. Worth notingSkipping recency boost before |
…ine active in vectorOnlyRetrieval Co-authored-by: Review Claw <review-claw@openclaw.ai>
Reviewer Must Fix: ✅ 已處理迴攻測試已加入: est/retriever-decay-recency-double-boost.mjs 包含 3 個測試案例:
深層分析額外發現(NIT,不阻擋 merge)
PR 核心 fix 正確,無 blocking 問題。 |
AliceLJY
left a comment
There was a problem hiding this comment.
Fix is correct and well-scoped. The guard this.decayEngine ? mapped : this.applyRecencyBoost(mapped) is consistent with the hybrid path pattern and prevents double-boosting. Test coverage is adequate.
CI cli-smoke failure is pre-existing on master (strip-envelope-metadata tests), unrelated to this PR.
Approved.
Summary
Skip
applyRecencyBoostinvectorOnlyRetrieval()when adecayEngineis present, preventing double-counting of recency in the scoring pipeline.What was fixed
Problem:
vectorOnlyRetrieval()always calledthis.applyRecencyBoost(mapped), but when adecayEngineis active, theapplyDecayBoost()stage already incorporates recency into its composite score. Calling both created a double-boost on recency, distorting ranking.Fix: Guard
applyRecencyBoostwith a ternary ??ifthis.decayEngineexists, usemappeddirectly; otherwise callthis.applyRecencyBoost(mapped).Files changed
src/retriever.ts: +5/-1 lines invectorOnlyRetrieval()Testing
Related