docs: Sprint 15 — seed 50 recipes + Sprint 12 latent-bug fix across all 6 running docs

Sprint 15 (commit a3c89bf) does two things: (1) reorders
backend/app/main.py so recipe_search_api.router mounts BEFORE
the WIP recipes_api.public_router (fixes a Sprint 12 latent
bug where /api/recipes/search was shadowed by the WIP's GET
/{recipe_id} returning 422); (2) adds scripts/seed_recipes.py
which seeded 18 Spoonacular recipes into the local library
today (free-tier 50-pt cap hit; remaining 32 to seed on later
days via the same idempotent script). DB went 31 -> 49 total
recipes.

This commit updates the 6 running docs that track sprints:

- .agent/plan.md — Sprint 15 section (S15.1-S15.4 + Done
  when + Out of scope) added after Sprint 14's out-of-scope.
- .agent/context.md — Sprint 15 decisions (D1-D6), open
  questions (Q1-Q2), and file:line references added.
- Review/sprint15-verification.md — NEW: full 18-imported
  breakdown by cuisine + free-tier math correction (50 pts/day,
  not 150) + LLM test (picked_count=0, filled_count=19,
  failed_count=2 for week 2026-07-06) + 6-risk table + deploy
  + 2 follow-up tickets (lower _DAILY_LIMIT, re-run script).
- Review/ui-nielsen-audit.md — Sprint 15 status block
  (T8.1-T8.3) added after the Sprint 14 block. Notes the
  Sprint 12 latent-bug fix as the critical change for the
  upcoming Sprint 12 deploy.
- fix-ui-audit.md — Sprint 15 section (T8.1-T8.5) added after
  the Sprint 14 section. T8.1 documents the main.py mount
  order fix in detail. T8.5 surfaces 2 follow-up tickets.
- Review/handoff-ui-audit.md — Batch K line in the deploy
  list, Sprint 15 section after Sprint 14, TL;DR Sprint 15
  line, Last-updated footer updated.
- docs/HANDOFF.md — Sprint 15 section after Sprint 14, Last-
  updated footer updated. Notes the corrected free-tier math
  and the 2 follow-up tickets.

All 6 docs now reflect Sprint 15. The Sprint 12 latent-bug
fix is documented as a hard prerequisite for the upcoming
Sprint 12 deploy (without it, every 'Search the web' query
would 422). Re-running scripts/seed_recipes.py on a later
day will add the remaining 32 recipes (the script is
idempotent — already-imported IDs return 409 and are
skipped).
This commit is contained in:
2026-06-06 14:12:25 -07:00
parent a3c89bf6a2
commit 0668d40444
7 changed files with 307 additions and 3 deletions
+22 -2
View File
@@ -23,7 +23,8 @@ If you are a new agent continuing this work, do this **in order**:
- **Batch H:** Sprint 12 (one `git pull`, `docker compose up -d --build backend frontend` — backend has the new `recipe_search.py` router, frontend has the new toggle).
- **Batch I:** Sprint 13 (one `git pull`, `docker compose up -d --build backend frontend` — backend has the new `llm_plan.py` router, frontend has the new prompt modal).
- **Batch J:** Sprint 14 (one `git pull`, `npm install` in `frontend/`, `npm test` to confirm 7/7, then `docker compose up -d --build frontend` — no backend change, no migration; the 5 new devDeps land on `npm install`).
4. **Open issues** in `.agent/plan.md` (the "Phase R1-R3" section is a prior plan; the **Sprint 14 active-sprint** section is the current state) and in `.agent/context.md` (decisions + open Qs for the current sprint).
- **Batch K:** Sprint 15 (one `git pull`, `docker compose up -d --build backend frontend` — backend picks up the `main.py` mount-order fix; the 18 new recipes are already in the DB; frontend has no changes).
4. **Open issues** in `.agent/plan.md` (the "Phase R1-R3" section is a prior plan; the **Sprint 15 active-sprint** section is the current state) and in `.agent/context.md` (decisions + open Qs for the current sprint).
5. **Do not** touch the pre-existing WIP files: `backend/app/api/recipes.py`, `backend/app/schemas/recipe.py`, `nginx/nginx.conf` (untouched since before this work; user's to manage).
6. **When you commit,** use the `fix(ui):`, `feat(ui):`, `refactor(frontend):`, `docs(review):` Conventional Commit style. Force-add new files in `frontend/src/lib/` (the `.gitignore` line 17 `lib/` is a pre-existing bug that catches it).
@@ -32,6 +33,7 @@ If you are a new agent continuing this work, do this **in order**:
- Sprints 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8: code committed and build green. Sprint 1 deployed. Sprints 2-8 awaiting user deploy.
- The §Future backlog is now empty: F1 (onboarding) shipped as Sprint 9; the dead "Generate Meal Plan" CTA shipped as Sprint 11; F8 (Spoonacular) shipped as Sprint 12; F9-lite shipped as Sprint 13. All four are deployment-pending. F9-full (local Ollama model pull) is the only remaining §Future item — opt-in based on cloud-billing feedback.
- **Sprint 14 (Vitest for `useOnboarding`, Q4) code complete on 2026-06-05.** 7/7 tests green in ~25 ms, `npm run build` green, no runtime dep change. Awaiting commit + push. Closes the open Q4 from Sprint 9.
- **Sprint 15 (Seed 50 family-friendly recipes + Sprint 12 latent-bug fix) code complete on 2026-06-06.** 18 Spoonacular recipes imported (free-tier 50-pt cap hit; remaining 32 to be seeded on later days). DB went 31 → 49 total recipes. LLM test for week 2026-07-06: `picked_count=0 / filled_count=19 / failed_count=2` (library fill covered 19/21 slots). Sprint 12 latent-bug fix: `main.py` mount order. Awaiting commit + push.
- Pre-existing repo issues: 1 failing test (`test_filter_blocks_by_cost` — verified pre-Sprint 8), `.gitignore` `lib/` bug, no CI. Documented.
---
@@ -145,6 +147,24 @@ If you are a new agent continuing this work, do this **in order**:
**Tracking docs:** `Review/sprint14-verification.md` (deploy + test commands + 5-risk table + open Q1), `Review/ui-nielsen-audit.md` Sprint 14 status block, `fix-ui-audit.md` T7.1T7.5, this file, `docs/HANDOFF.md` Sprint 14 section.
### Sprint 15 — Seed 50 family-friendly recipes for 4-week planning (content op) + Sprint 12 latent-bug fix (user-driven)
**Status: CODE COMPLETE on 2026-06-06. 18 Spoonacular recipes imported today (free-tier 50-pt cap hit; remaining 32 to seed on later days). DB went 31 → 49 total recipes. `main.py` mount-order fix verified (Sprint 12 latent bug). Awaiting user commit + push.** No frontend change, no migration, no runtime dep change.
**Root cause (one-liner):** User direction (2026-06-05): "Lets build out recipes for the coming 4 weeks in advance. In order to do this, lets add more recipes to the list of available ones." During Sprint 15 I also discovered that Sprint 12's `/api/recipes/search` route is shadowed by the pre-existing WIP's `GET /{recipe_id}` — without the `main.py` mount-order fix, every "Search the web" query would 422.
**Scope (4 boxes):**
1. **`backend/app/main.py` mount-order fix** — moved `recipe_search_api.router` import to line 39 + moved the `include_router` call to before `recipes_api.public_router`. 3-line comment explains the why. Verified `GET /api/recipes/search?q=...` returns 200 with hits; `POST /api/recipes/import` still 201; WIP's `GET /{recipe_id}` still works for valid UUIDs.
2. **`scripts/seed_recipes.py` (NEW, ~150 lines)** — 50-query one-shot Python script. Hits Spoonacular's `complexSearch` directly (avoids the broken backend route during the time before the main.py fix took effect; also avoids the backend's quota counter). For each query: takes the top hit, POSTs to the backend's `/api/recipes/import`. Idempotent (409 on duplicate). 1.5 sec sleep. Stops cleanly on 402 (quota exhausted).
3. **18 recipes imported today** (free-tier 50-pt cap hit at query 28). Distribution: 8 Italian + 7 Mexican + 3 Asian + 0 American + 0 Mediterranean (American + Mediterranean queries came after the cap). Plus 1 from earlier manual test (Pasta with Garlic, Scallions, Cauliflower & Breadcrumbs, ext=716429). DB now has 49 total recipes.
4. **LLM test** (Sprint 13 endpoint, week 2026-07-06): `picked_count=0 / filled_count=19 / failed_count=2`. Library fill covered 19/21 slots; the LLM (kimi-k2.6:cloud) returned 0 picks. Sprint 13 tolerance worked as designed (zero-pick response is not a crash).
**Cost (corrected):** free tier is 50 pts/day, not 150. 50 queries = 50 × 1.10 (search) + 50 × 1 (import) = 105 pts. Need 3 days on free tier. **Follow-up: lower `_DAILY_LIMIT=140` in `recipe_search.py:48` to 45** to match the real cap (5-pt safety margin).
**No pre-existing WIP files touched.** Only `main.py` was reordered (one-line + comment); `recipes.py`, `schemas/recipe.py`, `nginx.conf` are unchanged.
**Tracking docs:** `Review/sprint15-verification.md` (full 18-imported breakdown by cuisine + free-tier math + LLM test + 6-risk table + deploy + 2 follow-up tickets), `Review/ui-nielsen-audit.md` Sprint 15 status block (T8.1-T8.3), `fix-ui-audit.md` Sprint 15 section (T8.1-T8.5), this file, `docs/HANDOFF.md` Sprint 15 section.
### Sprint 7 — Fix webui "empty meal plan" (date-semantics mismatch)
**Status: COMMITTED `09c7525` on 2026-06-05. Build green.** Awaiting user to `git pull` + run the SQL fix + rebuild.
@@ -422,4 +442,4 @@ cd frontend && npm run build
Trust the build output. Trust the smoke checklist. Don't trust the deployment host's UI until the user confirms. The verification model is "I shipped, you verified, you reported, I fixed" — the agent in this role never sees the live UI directly.
**Last updated: 2026-06-05** — Sprint 1 deployed; Sprints 2-6 awaiting user deploy; **Sprint 7 (`09c7525`), Sprint 8 (`efd1fc6`), Sprint 9 (F1 Onboarding Tour) + post-deploy fix (`1562929`), Sprint 10 (Deny Forever on Recipes), Sprint 11 (Wire the dead "Generate Meal Plan" CTA), Sprint 12 (F8 Spoonacular search), and Sprint 13 (F9-lite Ollama Cloud plan synthesis) committed on 2026-06-05, awaiting user deploy; Sprint 14 (Vitest for `useOnboarding`) code complete, 7/7 tests green, awaiting commit + push**. See the "How to take over" and "Pending user deploy" sections at the top of this file.
**Last updated: 2026-06-06** — Sprint 1 deployed; Sprints 2-6 awaiting user deploy; **Sprint 7 (`09c7525`), Sprint 8 (`efd1fc6`), Sprint 9 (F1 Onboarding Tour) + post-deploy fix (`1562929`), Sprint 10 (Deny Forever on Recipes), Sprint 11 (Wire the dead "Generate Meal Plan" CTA), Sprint 12 (F8 Spoonacular search), and Sprint 13 (F9-lite Ollama Cloud plan synthesis) committed on 2026-06-05, awaiting user deploy; Sprint 14 (Vitest for `useOnboarding`) committed on 2026-06-05, awaiting user push; Sprint 15 (Seed 50 family-friendly recipes + Sprint 12 latent-bug fix) code complete on 2026-06-06, 18 recipes imported, awaiting user commit + push**. See the "How to take over" and "Pending user deploy" sections at the top of this file.