feat(retrieval): require practice_area only for internal/cases; enable searchable filter + health visibility (GAP-13, FU-2a)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-30 20:57:27 +00:00
parent 6dbcb7e798
commit 358d82e90e
3 changed files with 23 additions and 4 deletions

View File

@@ -70,6 +70,15 @@ def test_compute_searchable_false_without_core_fields():
assert db._compute_searchable(row, has_embedded_chunk=True) is False
def test_compute_searchable_external_allows_empty_practice_area():
# External precedents (e.g. בג"ץ) are cross-domain — empty practice_area
# must NOT disqualify them, as long as the rest of the contract holds.
row = _complete_row()
row["source_kind"] = "external_upload"
row["practice_area"] = ""
assert db._compute_searchable(row, has_embedded_chunk=True) is True
# ── ingest wires in recompute_searchable (both types) ──────────────────
def test_ingest_calls_recompute_searchable(monkeypatch, tmp_path):
calls = {"recompute": [], "meta": [], "hal": []}