kiwi/tests/services/recipe
pyr0ball 896b4e048c feat: recipe scanner — photo to structured recipe (kiwi#9)
New feature: photograph a recipe card, cookbook page, or handwritten
note and have it extracted into a structured, editable recipe.

Backend:
- POST /recipes/scan: accept 1-4 photos, run VLM extraction, return
  structured JSON for review (not auto-saved)
- POST /recipes/scan/save: persist a reviewed/edited recipe
- GET/DELETE /recipes/user: user-created recipe CRUD
- Vision backend priority: cf-orch -> local Qwen2.5-VL -> Anthropic BYOK
- 503 with clear config hint when no vision backend available
- Multi-photo support: facing pages (ingredients/directions) sent together
- Pantry cross-reference: marks which ingredients are already on hand
- migration 041: user_recipes table (title, servings, cook_time, steps,
  ingredients JSON, source, pantry_match_pct)
- Tier gate: recipe_scan -> paid, BYOK-unlockable

Frontend:
- "Scan" button in the Recipes tab bar (camera icon)
- RecipeScanModal: upload step (drag-drop + file picker, up to 4 photos,
  live previews), processing step (spinner), review/edit step (all
  fields inline-editable before save), pantry match badge, warning banner
  for low-confidence or incomplete scans

Tests: 35 new tests (23 unit + 12 API), 404 total passing
2026-04-27 08:23:01 -07:00
..
__init__.py feat: ElementClassifier -- ingredient element tagging with heuristic fallback 2026-03-30 22:59:46 -07:00
test_assembly_build.py feat: add get_role_candidates() and build_from_selection() to assembly engine 2026-04-14 11:06:08 -07:00
test_element_classifier.py fix: ElementClassifier — guard empty input, safe JSON decode, dedup heuristic elements, strengthen test assertions 2026-03-30 23:10:49 -07:00
test_llm_recipe.py fix: address recipe/OCR quality issues from review 2026-04-02 12:41:59 -07:00
test_recipe_engine.py feat: cross-encoder reranker for recipe suggestions (kiwi#117) 2026-04-24 16:39:51 -07:00
test_recipe_scanner.py feat: recipe scanner — photo to structured recipe (kiwi#9) 2026-04-27 08:23:01 -07:00
test_reranker.py feat: cross-encoder reranker for recipe suggestions (kiwi#117) 2026-04-24 16:39:51 -07:00
test_staple_library.py fix: staple library — consistent tofu_firm slug, load error handling, typed yield_formats, expanded test coverage 2026-03-30 23:10:51 -07:00
test_style_adapter.py feat: recipe engine Phase 3 — StyleAdapter, LLM levels 3-4, user settings 2026-03-31 14:15:18 -07:00
test_substitution_engine.py fix: test fixture — add protein_delta to substitution_pairs inserts 2026-03-30 23:16:15 -07:00