KeywordSearcher.search() crashes with ZeroDivisionError (inside rank-bm25's IDF computation) when index() was called with an empty corpus. Searching an empty index should return an empty result list, not crash.
The covering test is marked @pytest.mark.xfail referencing manifest id H-01 — remove the marker as part of the fix.
Relevant files:
rag/retriever/keyword_search.py
tests/unit/test_keyword_search.py
Estimated effort: 2–4 hours
KeywordSearcher.search()crashes withZeroDivisionError(inside rank-bm25's IDF computation) whenindex()was called with an empty corpus. Searching an empty index should return an empty result list, not crash.The covering test is marked
@pytest.mark.xfailreferencing manifest id H-01 — remove the marker as part of the fix.Relevant files:
rag/retriever/keyword_search.pytests/unit/test_keyword_search.pyEstimated effort: 2–4 hours