kiwi/app/db/migrations
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
..
001_initial_schema.sql chore: initial commit — kiwi Phase 2 complete 2026-03-30 22:20:48 -07:00
002_inventory_and_products.sql chore: initial commit — kiwi Phase 2 complete 2026-03-30 22:20:48 -07:00
003_receipt_data.sql chore: initial commit — kiwi Phase 2 complete 2026-03-30 22:20:48 -07:00
004_tagging_system.sql chore: initial commit — kiwi Phase 2 complete 2026-03-30 22:20:48 -07:00
005_receipt_staged_status.sql feat: migrations 005-011 — fix receipts column bug + recipe engine tables 2026-03-30 22:33:25 -07:00
006_element_profiles.sql feat: migrations 005-011 — fix receipts column bug + recipe engine tables 2026-03-30 22:33:25 -07:00
007_recipe_corpus.sql fix: data pipeline — R-vector parser, allrecipes dataset, unique recipe index 2026-03-31 21:36:13 -07:00
008_substitution_pairs.sql feat: migrations 005-011 — fix receipts column bug + recipe engine tables 2026-03-30 22:33:25 -07:00
009_staple_library.sql feat: migrations 005-011 — fix receipts column bug + recipe engine tables 2026-03-30 22:33:25 -07:00
010_recipe_feedback.sql feat: migrations 005-011 — fix receipts column bug + recipe engine tables 2026-03-30 22:33:25 -07:00
011_rate_limits.sql feat: migrations 005-011 — fix receipts column bug + recipe engine tables 2026-03-30 22:33:25 -07:00
012_user_settings.sql feat: recipe engine Phase 3 — StyleAdapter, LLM levels 3-4, user settings 2026-03-31 14:15:18 -07:00
013_background_tasks.sql fix: renumber background_tasks migration 006→013 (conflict with element_profiles) 2026-03-31 14:28:10 -07:00
014_nutrition_macros.sql feat: recipe engine — assembly templates, prep notes, FTS fixes, texture backfill 2026-04-02 22:12:35 -07:00
015_recipe_fts.sql fix: add FTS5 sync triggers so recipe inserts are indexed immediately 2026-04-02 23:14:22 -07:00
016_recipe_fts_triggers.sql fix: add FTS5 sync triggers so recipe inserts are indexed immediately 2026-04-02 23:14:22 -07:00
017_household_invites.sql feat: add household_invites migration (017) 2026-04-04 22:27:56 -07:00
018_saved_recipes.sql feat: saved recipes, recipe browser, and recipe detail panel 2026-04-08 14:35:02 -07:00
019_recipe_collections.sql feat: saved recipes, recipe browser, and recipe detail panel 2026-04-08 14:35:02 -07:00
020_browser_telemetry.sql feat: saved recipes, recipe browser, and recipe detail panel 2026-04-08 14:35:02 -07:00
021_recipe_browser_fts.sql perf(browser): replace LIKE scans with FTS5; cache category counts 2026-04-08 23:10:48 -07:00
022_meal_plans.sql feat(db): add meal_plans, slots, prep_sessions, prep_tasks migrations (022-025) 2026-04-12 13:11:34 -07:00
022_recipe_generic_flag.sql chore: commit in-progress work -- tag inferrer, imitate endpoint, hall-of-chaos easter egg, migration files, Dockerfile .env defense 2026-04-14 13:23:15 -07:00
023_meal_plan_slots.sql feat(db): add meal_plans, slots, prep_sessions, prep_tasks migrations (022-025) 2026-04-12 13:11:34 -07:00
024_prep_sessions.sql feat(db): add meal_plans, slots, prep_sessions, prep_tasks migrations (022-025) 2026-04-12 13:11:34 -07:00
025_prep_tasks.sql feat(db): add meal_plans, slots, prep_sessions, prep_tasks migrations (022-025) 2026-04-12 13:11:34 -07:00
028_community_pseudonyms.sql feat(community): migration 028 — community_pseudonyms table in per-user kiwi.db 2026-04-13 08:13:39 -07:00
029_inferred_tags.sql chore: commit in-progress work -- tag inferrer, imitate endpoint, hall-of-chaos easter egg, migration files, Dockerfile .env defense 2026-04-14 13:23:15 -07:00
030_opened_date.sql feat: pantry intel cluster — #61 expiry display, #64 cook log, #66 scaling, #59 open-package tracking 2026-04-16 06:01:25 -07:00
031_disposal_reason.sql feat: partial consumption tracking and waste/disposal logging (#12 #60) 2026-04-16 07:28:21 -07:00
032_meal_plan_unique_week.sql fix: meal planner week add button crashing on r.name / add duplicate guard 2026-04-16 10:46:28 -07:00
033_shopping_list.sql fix: recipe enrichment backfill, main_ingredient browser domain, bug batch 2026-04-18 15:38:56 -07:00
034_recipe_jobs.sql feat(recipes): async L3/L4 recipe job queue with poll endpoint 2026-04-19 21:44:27 -07:00
035_sensory_tags.sql feat: sensory profile filter — texture/smell/noise filtering for Browse and Find (kiwi#51) 2026-04-24 09:47:48 -07:00
036_captured_products.sql feat: visual label capture for unenriched barcodes (kiwi#79) 2026-04-24 17:57:25 -07:00
037_products_source_visual_capture.sql fix: extend source CHECK constraints to include visual_capture (kiwi#79) 2026-04-25 08:46:44 -07:00
038_inventory_items_source_visual_capture.sql fix: extend source CHECK constraints to include visual_capture (kiwi#79) 2026-04-25 08:46:44 -07:00
039_saved_recipes_drop_fk.sql fix(saved-recipes): resolve FK constraint, null title, and load reliability 2026-04-25 21:44:10 -07:00
040_corrections.sql feat: corrections router (#73) + Magpie flywheel hook (#28) 2026-04-25 23:31:20 -07:00
041_user_recipes.sql feat: recipe scanner — photo to structured recipe (kiwi#9) 2026-04-27 08:23:01 -07:00