From c0875ccae9409c5b1cc1d09f004205342de723a6 Mon Sep 17 00:00:00 2001 From: safishamsi Date: Wed, 15 Jul 2026 15:09:17 +0100 Subject: [PATCH] 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) --- tests/bench_query_scoring.py | 2 +- tests/test_serve.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/bench_query_scoring.py b/tests/bench_query_scoring.py index 375c9449..68e6ce4b 100644 --- a/tests/bench_query_scoring.py +++ b/tests/bench_query_scoring.py @@ -277,4 +277,4 @@ def main(argv: list[str] | None = None) -> int: if __name__ == "__main__": - sys.exit(main()) \ No newline at end of file + sys.exit(main()) diff --git a/tests/test_serve.py b/tests/test_serve.py index 855cdc41..30278718 100644 --- a/tests/test_serve.py +++ b/tests/test_serve.py @@ -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