fix(seahorse): correct bm25 rank semantics in comments (#2360)

SQLite FTS5 bm25() returns negative values where numerically smaller
(more negative) indicates a better match. The official docs state:

  "The better the match, the numerically smaller the value returned."

Two comments incorrectly stated "closer to 0 = better match" and
"lower = better match". Updated all rank descriptions to use the
unambiguous "more negative = higher relevance" phrasing.

This matters because these comments are used as tool prompt hints
for LLM agents, and incorrect semantics could lead to wrong ranking
decisions.
This commit is contained in:
Liu Yuan
2026-04-07 12:32:28 +08:00
committed by GitHub
parent 661ce5e311
commit f0e6b7aa37
2 changed files with 5 additions and 5 deletions
+3 -3
View File
@@ -68,8 +68,8 @@ type GrepSummaryResult struct {
Depth int `json:"depth"`
Kind SummaryKind `json:"kind"`
ConversationID int64 `json:"conversationId"`
// Rank is the bm25 relevance score (negative value, closer to 0 = better match).
// Examples: -0.5 = excellent match, -2.0 = good match, -10.0 = partial match.
// Rank is the bm25 relevance score (negative value, lower = better match).
// Examples: -5.0 = excellent match, -2.0 = good match, -0.5 = partial match.
Rank float64 `json:"rank,omitempty"`
}
@@ -79,7 +79,7 @@ type GrepMessageResult struct {
Snippet string `json:"snippet"`
Role string `json:"role"`
ConversationID int64 `json:"conversationId"`
Rank float64 `json:"rank,omitempty"` // Relevance score (lower = better match)
Rank float64 `json:"rank,omitempty"` // Relevance score (more negative = better match)
}
// ExpandMessagesResult contains expanded messages.
+2 -2
View File
@@ -56,8 +56,8 @@ Returns:
"hint": "No matches. Try: %keyword% for fuzzy search"
}
Rank field (FTS5 mode only): bm25 relevance score, negative value where closer to 0 = better match.
Examples: -0.5=excellent, -2=good, -5=partial, -10=weak. LIKE mode (%pattern%) has no rank.
Rank field (FTS5 mode only): bm25 relevance score, negative value where more negative = higher relevance.
Examples: -5=excellent, -2=good, -0.5=partial. LIKE mode (%pattern%) has no rank.
Examples:
{"pattern": "authentication"}