test(serve): rebase #1900 test onto #1918 _score_query API; bench newline

PR #1918 replaced _pick_seeds(terms=) with best_seed_by_term= from
_score_query. Update the #1900 German-stopword seed test to the new
single-traversal API and add the missing trailing newline in the
(manual, non-collected) query-scoring benchmark.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
safishamsi
2026-07-15 15:09:17 +01:00
co-authored by Claude Opus 4.8
parent ff999a909a
commit c0875ccae9
2 changed files with 6 additions and 2 deletions
+1 -1
View File
@@ -277,4 +277,4 @@ def main(argv: list[str] | None = None) -> int:
if __name__ == "__main__":
sys.exit(main())
sys.exit(main())
+5 -1
View File
@@ -393,7 +393,11 @@ def test_pick_seeds_german_query_seeds_content_node_not_heading_noise():
q = "Wie funktioniert die Authentifizierung?"
terms = _query_terms(q)
seeds = _pick_seeds(_score_nodes(G, terms), G=G, terms=terms)
# #1918: _score_query does combined scoring + per-term singleton winners in
# one traversal; _pick_seeds consumes best_seed_by_term for the per-term
# guarantee (replaces the old terms= per-term rescoring).
qs = _score_query(G, terms, collect_per_term_seeds=True)
seeds = _pick_seeds(qs.ranked, G=G, best_seed_by_term=qs.best_seed_by_term)
assert "auth" in seeds
assert "cfg" not in seeds
assert "sec" not in seeds