diff --git a/memory/2026-02-27-predictor-bug-fix-reject-mismatched-candidate-feat.md b/memory/2026-02-27-predictor-bug-fix-reject-mismatched-candidate-feat.md new file mode 100644 index 000000000..64e088bd1 --- /dev/null +++ b/memory/2026-02-27-predictor-bug-fix-reject-mismatched-candidate-feat.md @@ -0,0 +1,12 @@ +# 2026-02-27 Session Notes + +## Predictor Bug Fix: Reject Mismatched candidate_features + +Nicholai implemented a fix to eliminate silent data corruption in `packages/predictor/src/main.rs` (line 79). The code previously silently replaced mismatched `candidate_features` vectors with all-zero values when their length didn't match `candidate_ids`. This masked upstream bugs and degraded ranking quality without signaling the problem. + +The fix changed the logic to: +1. If `candidate_features` is empty → zero-fill (correct, feature not provided) +2. If length matches `candidate_ids` → use as-is (correct, provided correctly) +3. If provided but length mismatches → return explicit error (fixed from silent zero-fill) + +This brings consistency with how `candidate_embeddings` and `candidate_texts` already handle the same scenario (returning explicit length-mismatch errors). The change was applied via Edit tool and preserves the empty-features fallback behavior while fixing the dangerous silent-corruption case. \ No newline at end of file diff --git a/memory/memories.db-wal b/memory/memories.db-wal index 07f85ae2c..b89c60f73 100644 Binary files a/memory/memories.db-wal and b/memory/memories.db-wal differ