Skip to content

fix(recall): prefer smart_score as ranking key in RecalledMemory - #154

Merged
ferhimedamine merged 2 commits into
mainfrom
fix/smart-score-deserialization
Jul 3, 2026
Merged

fix(recall): prefer smart_score as ranking key in RecalledMemory#154
ferhimedamine merged 2 commits into
mainfrom
fix/smart-score-deserialization

Conversation

@ferhimedamine

Copy link
Copy Markdown
Contributor

Summary

Fixes [DAK-7313]: RecalledMemory.score was reading score || weighted_score and ignoring smart_score, causing the reported score to differ from the server's actual ranking key.

Root cause: Server sorts recall results by smart_score (fallback weighted_scorescore), but RecalledMemory::deserialize never read smart_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.score now resolves as smart_score ?? weighted_score ?? score — matching the server's ranking key
  • smart_score: Option<f32> and weighted_score: Option<f32> added as exposed fields for analytics consumers
  • 4 unit tests covering all fallback paths and flat-format decode

Test results (local):

running 4 tests ... (CI validates — cargo build blocked on prod per DAK-4495)

Part of DAK-7313 (all 4 SDKs fixed in one batch).

🤖 Generated with Claude Code

…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>
@ferhimedamine ferhimedamine added the auto-merge CTO auto-merge approved label Jul 3, 2026
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ferhimedamine

Copy link
Copy Markdown
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.

@ferhimedamine
ferhimedamine merged commit cb97149 into main Jul 3, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-merge CTO auto-merge approved

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant