refactor(search): remove NLP/smart-search feature entirely #772

Merged
marcel merged 51 commits from worktree-feat+nlp-service into main 2026-06-08 10:57:01 +02:00
2 changed files with 15 additions and 1 deletions
Showing only changes of commit d65879d273 - Show all commits

View File

@@ -50,4 +50,4 @@ def parse(request: ParseRequest) -> ParseResponse:
try:
return extract(request.query, request.lang)
except Exception as exc:
raise HTTPException(status_code=500, detail=str(exc)) from exc
raise HTTPException(status_code=500, detail="internal error") from exc

View File

@@ -79,3 +79,17 @@ def test_parse_all_languages(client):
r = client.post("/parse", json={"query": query, "lang": lang})
assert r.status_code == 200, f"Failed for lang={lang}"
assert r.json()["dateTo"] == "1920-12-31", f"Wrong dateTo for lang={lang}"
def test_parse_internal_exception_does_not_leak_detail(client, monkeypatch):
"""500 errors must return generic message — never expose internal details."""
import main as main_module
def _boom(query, lang):
raise RuntimeError("postgresql://archive_user:s3cr3t@db:5432/family_archive_db")
monkeypatch.setattr(main_module, "extract", _boom)
r = client.post("/parse", json={"query": "test", "lang": "de"})
assert r.status_code == 500
assert "s3cr3t" not in r.text
assert r.json()["detail"] == "internal error"