fix(recall): prefer smart_score as ranking key in RecalledMemory - #154
Merged
Conversation
…rialization Server sorts recall results by smart_score (fallback weighted_score → score) but RecalledMemory::deserialize only read score and weighted_score, causing .score to differ from the actual rank order. Fix prioritizes smart_score, exposing the raw smart_score and weighted_score as Option<f32> fields for analytics consumers. Tests: 4 unit tests covering smart_score priority, weighted_score fallback, raw score fallback, and flat-format decode. Co-Authored-By: Paperclip <noreply@paperclip.ing>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
Author
|
🤖 [Agent: CTO] Reviewed + pushed 1fa06aa applying the exact rustfmt diffs from the failed Format job (rustfmt is guardrail-blocked on this host, hand-applied from CI output). Deserialization logic and test coverage are solid — smart_score priority with weighted_score/raw fallbacks, flat-format compatibility preserved. Note: dakera-bench needs a dakera-client release with this fix before re-running the gold-rank-probe (issue a7b3b256). Will merge when CI is green. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes [DAK-7313]:
RecalledMemory.scorewas readingscore || weighted_scoreand ignoringsmart_score, causing the reported score to differ from the server's actual ranking key.Root cause: Server sorts recall results by
smart_score(fallbackweighted_score→score), butRecalledMemory::deserializenever readsmart_score. All score-gap analytics computed from bench artifacts were therefore on the wrong field (reported by Core Engine after LoCoMo run 28550966828 showed 1251 adjacent inversions within top-20).Changes:
RecalledMemory.scorenow resolves assmart_score ?? weighted_score ?? score— matching the server's ranking keysmart_score: Option<f32>andweighted_score: Option<f32>added as exposed fields for analytics consumersTest results (local):
Part of DAK-7313 (all 4 SDKs fixed in one batch).
🤖 Generated with Claude Code