feat(sofiia-console): rank runbook search results with bm25

FTS path: score = bm25(docs_chunks_fts), ORDER BY score ASC; LIKE fallback: score null; test asserts score key present

Made-with: Cursor
This commit is contained in:
Apple
2026-03-03 04:36:52 -08:00
parent 63fec4371a
commit 4db1774a34
2 changed files with 16 additions and 8 deletions

View File

@@ -49,6 +49,8 @@ def test_runbooks_search_finds_rehearsal(sofiia_module, tmp_path, tmp_docs_with_
assert any("rehearsal" in p for p in paths), f"Expected path containing 'rehearsal', got {paths}"
first = items[0]
assert "path" in first and "title" in first and "snippet" in first
assert "score" in first
assert first["score"] is None or isinstance(first["score"], (int, float))
def test_runbooks_preview_returns_headings(sofiia_module, sofiia_client, tmp_path, tmp_docs_with_rehearsal, monkeypatch):