Skip to content

Commit d54ae3b

Browse files
committed
docs(internal): say the name score is not capped, not that it is unbounded
The comment described `_calculate_entity_score` as accumulating "without a ceiling". The function is a finite sum of bounded terms — three `calculate_*_ratio` helpers that each return 0-100, plus fixed exact/partial and keyword bonuses — so a bound does exist. What matters for the surrounding argument is only that the bound is not 100, which is what the sentence now says. The rest of the comment is unchanged.
1 parent 589d4a2 commit d54ae3b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/ha_mcp/tools/smart_search/_graph.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,8 +362,8 @@ async def fetch_related_buckets(client: Any, entity_id: str) -> GraphResult | No
362362
# Fuzzy mode is not symmetric, and no value here makes it so without breaking
363363
# the tie above: the 100 cap belongs to the config-body score
364364
# (``_search_in_dict``), while the NAME score from ``_calculate_entity_score``
365-
# accumulates without a ceiling — a name echoing the queried entity's words can
366-
# pass 100 on its own. So with ``exact_match=False`` a graph-ONLY hit
365+
# is not capped at 100 — a name echoing the queried entity's words can pass
366+
# 100 on its own. So with ``exact_match=False`` a graph-ONLY hit
367367
# (``_merge_graph_hits`` leaves an already-scored record's score alone) can sort
368368
# below a match that merely resembles the query, and land on a later page under
369369
# a small ``limit``. It is still counted in ``total_matches`` unless visibility

0 commit comments

Comments
 (0)