fix(search): show similarity, not fused rank, as match - #171
Merged
Paul-Kyle merged 2 commits intoAug 31, 2026
Conversation
Paul-Kyle
approved these changes
Aug 31, 2026
Paul-Kyle
left a comment
Member
There was a problem hiding this comment.
Merging. The shared helper is the right shape here: MCP and CLI make the same three-way decision once, numeric raw cosine is the only value presented as match percentage, present-null is labelled as keyword-only plus rank, and an absent legacy field is rank-only. I re-read the refreshed four-file diff at 5d591f3 after the branch update and all 9 required checks are green. This remains correctly partial, so #150 stays open for the TypeScript and hook renderers.
This was referenced Sep 1, 2026
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.
Part of #150, taking the two Python surfaces. The OpenClaw and shared-core TypeScript renderers and the hook pair are not in this PR.
Presentation only, as you asked.
scoreandraw_scoreon the REST payload are untouched.The three cases are decided in one place,
palinode/core/scoring.py, rather than once per surface. You flagged the duplicated jq as a wart you did not want extended; two Python renderers making the same judgement separately is the same wart in a different language, so MCP and the CLI now both calldescribe_match.100% match42% matchraw_score: null(BM25-only)100% matchkeyword match, rank 1.00raw_scoreabsent (pre-0.12)100% matchrank 1.00I kept the null and absent cases apart, as you asked. A null means the ranker told us this hit had no vector arm, so the surface says which arm did fire. An absent field means the server never sent one and the arm is unknown, so the rank is all it says. Neither claims a similarity.
On the naming:
rank, used everywhere. For the BM25-only case I went with a word rather than silence.keyword matchsays what actually matched, and dropping the number entirely loses the ordering a reader is using the flag to see. It reads as a match without ever reading as a similarity, which was the property you wanted.Validation
pytest -q: 3263 passed, 10 skipped, 5 xfailedruff check: cleanmcp.pyandsearch.pygives[1.00] notes/a.mdfrom the CLI and(100% match)from MCP.The tests use the measured numbers from the issue: 0.421 as the median of the 32 searches, and each of the three points across the 0.402 to 0.459 range asserted to render under half.