Commit dbd0428
fix(memory): validate weights + deterministic tie-break; port #3104 lockfile fix
Per ruvnet's review on #3119:
- weighted RRF fusion previously had undefined ranking semantics for
malformed weights (NaN poisons the sort comparator, negative/Infinity
invert or swamp the intended ordering). Each weight component now
validates independently (finite, >= 0) and falls back to its own
documented default otherwise, same degradation as an omitted weights
field already had.
- rrf ties now break deterministically by entry.id (explicit secondary
sort key) instead of relying on Array.sort's stability plus Map
insertion order as an undocumented side effect.
- 4 new tests: 3 malformed-weight fallback cases + 1 genuine-tie
(weights: {semantic:0, structured:0}) deterministic-order case.
Also ports PR #3104's fix verbatim (v3/pnpm-lock.yaml: @claude-flow/mcp
specifier ^3.0.0-alpha.9 -> 3.0.0-alpha.10, matching the CLI manifest's
exact pin) to unblock the install-dependent CI gates this PR needs to
actually execute (issue #3101, also flagged in the review). Root-level
npm ETARGET (issue #3095, package-lock.json) is a separate, still-open,
maintainer-flagged issue with no proposed fix yet -- not addressed here.
Validated: `corepack pnpm install --frozen-lockfile --lockfile-only` and
`--ignore-scripts` both succeed from v3/; full @claude-flow/memory suite
465/466 (same 1 pre-existing unrelated env failure); tsc --noEmit clean.
Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01AjuAxfhZi6eZXnLbLC14Ay1 parent b901326 commit dbd0428
3 files changed
Lines changed: 59 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
318 | 318 | | |
319 | 319 | | |
320 | 320 | | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
321 | 357 | | |
322 | 358 | | |
323 | 359 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
689 | 689 | | |
690 | 690 | | |
691 | 691 | | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
692 | 708 | | |
693 | 709 | | |
694 | 710 | | |
695 | | - | |
| 711 | + | |
696 | 712 | | |
697 | 713 | | |
698 | 714 | | |
699 | 715 | | |
700 | 716 | | |
701 | | - | |
| 717 | + | |
702 | 718 | | |
703 | 719 | | |
704 | 720 | | |
705 | 721 | | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
706 | 725 | | |
707 | | - | |
| 726 | + | |
708 | 727 | | |
709 | 728 | | |
710 | 729 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments