kiwi/tests
pyr0ball b5eb8e4772 feat: cross-encoder reranker for recipe suggestions (kiwi#117)
Integrates cf-core reranker into the L1/L2 recipe engine. Paid+ tier
gets a BGE cross-encoder pass over the top-20 FTS candidates, scoring
each recipe against the user's full context: pantry state, dietary
constraints, allergies, expiry urgency, style preference, and effort
preference. Free tier keeps the existing overlap sort unchanged.

- New app/services/recipe/reranker.py: build_query, build_candidate_string,
  rerank_suggestions with tier gate (_RERANKER_TIERS) and graceful fallback
- rerank_score field added to RecipeSuggestion (None on free tier, float on paid+)
- recipe_engine.py: single call after candidate assembly, before final sort;
  hard_day_mode tier grouping preserved as primary sort when reranker active
- Fix pre-existing circular import in app/services/__init__.py (eager import
  of ReceiptService triggered store.py → services → receipt_service → store)
- 27 unit tests (mock backend, no model weights) + 2 engine-level tier tests;
  325 tests passing, no regressions
2026-04-24 16:39:51 -07:00
..
api feat(streaming): add POST /recipes/stream-token endpoint 2026-04-24 10:22:30 -07:00
db feat: add Store.get_element_profiles() for wizard role candidate lookup 2026-04-14 10:50:46 -07:00
pipeline feat: cloud auth bypass, VRAM leasing, barcode EXIF fix, pipeline improvements 2026-04-01 16:06:23 -07:00
services feat: cross-encoder reranker for recipe suggestions (kiwi#117) 2026-04-24 16:39:51 -07:00
test_services feat: time & effort signals — active/passive split, effort cards, annotated steps (kiwi#50) 2026-04-24 09:29:54 -07:00
test_tasks feat(tasks): add background task scheduler for LLM expiry fallback 2026-03-31 09:25:48 -07:00
__init__.py feat: data pipeline -- USDA FDC ingredient index builder 2026-03-30 22:44:25 -07:00
test_household.py fix: row_factory in _household_store; validate household_id from Heimdall; monkeypatch CLOUD_DATA_ROOT in accept test; add KIWI_BASE_URL to compose.cloud.yml 2026-04-04 22:59:06 -07:00
test_meal_plan_tiers.py feat(tiers): move meal_planning to Free; add meal_plan_config/llm/llm_timing keys 2026-04-12 13:12:11 -07:00
test_tag_sensory_profiles.py feat: sensory profile filter — texture/smell/noise filtering for Browse and Find (kiwi#51) 2026-04-24 09:47:48 -07:00
test_tiers.py feat: tiers -- leftover_mode rate-limited free, style_picker paid+, staple_library free 2026-03-30 22:50:35 -07:00