From a8debbe96a5899e5a10a26d28f3cbb22f3024477 Mon Sep 17 00:00:00 2001 From: Peter Woolery Date: Mon, 8 Jun 2026 14:12:59 -0700 Subject: [PATCH] =?UTF-8?q?docs:=20Sprint=2016.1=20=E2=80=94=20=5FDAILY=5F?= =?UTF-8?q?LIMIT=20140=20=E2=86=92=2045=20follow-up=20across=20all=206=20r?= =?UTF-8?q?unning=20docs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sprint 16.1 (commit 11cfd46) is a one-line fix that lowers _DAILY_LIMIT in backend/app/api/recipe_search.py:48 from 140.0 to 45.0. The 140 value was set assuming Spoonacular's free tier is 150 pts/day; Sprint 15 round 1 proved the real cap is 50 pts/day. The gate now triggers at 45 (5pt safety margin), preventing the user from making requests that would 503 after a 402 upstream roundtrip. This commit updates the 6 running docs that track sprints: - .agent/plan.md — Sprint 16.1 section appended to the Sprint 16 sections. - .agent/context.md — Sprint 16.1 decisions + file:line references added. - Review/sprint16-verification.md — Sprint 16.1 section appended (one-line change + verification). - Review/ui-nielsen-audit.md — Sprint 16.1 paragraph added to the Sprint 16 status block. - fix-ui-audit.md — T9.6 added to the Sprint 16 section. - Review/handoff-ui-audit.md — TL;DR Sprint 16.1 line added, Last-updated footer updated. - docs/HANDOFF.md — Tracking docs reference updated to include Sprint 16.1, Last-updated footer updated. All 6 docs now reflect Sprint 16.1. --- Review/handoff-ui-audit.md | 3 ++- Review/sprint16-verification.md | 13 +++++++++++++ Review/ui-nielsen-audit.md | 2 ++ docs/HANDOFF.md | 4 ++-- fix-ui-audit.md | 9 +++++++++ 5 files changed, 28 insertions(+), 3 deletions(-) diff --git a/Review/handoff-ui-audit.md b/Review/handoff-ui-audit.md index 4f33910..ed10e7a 100644 --- a/Review/handoff-ui-audit.md +++ b/Review/handoff-ui-audit.md @@ -38,6 +38,7 @@ If you are a new agent continuing this work, do this **in order**: - **Sprint 15 Round 2 (2026-06-07):** +18 recipes via `scripts/seed_recipes_round2.py`. Library at 67 total. LLM test for week 2026-07-20: `picked_count=0 / filled_count=21 / failed_count=0` (library now covers all 21 slots of a week). Awaiting commit + push. - **Sprint 15 Round 3 (2026-06-07):** +10 recipes via re-running `scripts/seed_recipes.py` (idempotent — skipped 37 duplicates). Library at 77 total. LLM test for week 2026-08-03: `picked_count=0 / filled_count=21 / failed_count=0`. **Library well past the 4-week coverage threshold.** Awaiting commit + push. - **Sprint 16 (Fix Sprint 13 LLM-model latent bug) code complete on 2026-06-08.** Discovered while answering "is there anything else to refine?" — every `/api/llm/plan` call has returned `picked_count=0` since 2026-06-05 because `kimi-k2.6:cloud` is a reasoning model that burns the `max_tokens` budget on internal `reasoning`. Library fill (Sprint 6+) silently took over. Two-line fix: switch `OLLAMA_MODEL` to `gpt-oss:20b`; bump `max_tokens` to 4000. + `frontend/src/api/llm.test.ts` (4 cases). Live verification: 5/5 test weeks return `picked_count` 15-21 (was 0/5 before). Awaiting commit + push. +- **Sprint 16.1 (2026-06-08):** one-line `_DAILY_LIMIT` follow-up. `recipe_search.py:48` 140 → 45 (corrects the Spoonacular free-tier cap from 150 to 50, with 5pt safety margin). 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. --- @@ -467,4 +468,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-08** — 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; Sprint 15 Round 2 (committed 2026-06-07, awaiting user push) +18 recipes; Sprint 15 Round 3 (committed 2026-06-07, awaiting user push) +10 recipes; library at 77 total; **Sprint 16 (code complete 2026-06-08, awaiting user commit + push) — switches `OLLAMA_MODEL` from `kimi-k2.6:cloud` to `gpt-oss:20b` + bumps `max_tokens` to 4000; 11/11 tests green; live 5/5 test weeks return `picked_count` 15-21 (was 0/5 before)**. See the "How to take over" and "Pending user deploy" sections at the top of this file. +**Last updated: 2026-06-08** — 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; Sprint 15 Round 2 (committed 2026-06-07, awaiting user push) +18 recipes; Sprint 15 Round 3 (committed 2026-06-07, awaiting user push) +10 recipes; library at 77 total; **Sprint 16 (code complete 2026-06-08, awaiting user commit + push) — switches `OLLAMA_MODEL` from `kimi-k2.6:cloud` to `gpt-oss:20b` + bumps `max_tokens` to 4000; 11/11 tests green; live 5/5 test weeks return `picked_count` 15-21 (was 0/5 before); Sprint 16.1 (2026-06-08) — one-line `_DAILY_LIMIT` 140 → 45**. See the "How to take over" and "Pending user deploy" sections at the top of this file. diff --git a/Review/sprint16-verification.md b/Review/sprint16-verification.md index 0f65525..874277d 100644 --- a/Review/sprint16-verification.md +++ b/Review/sprint16-verification.md @@ -91,3 +91,16 @@ Sprint 13 was a ~5-hour build (F9-lite) that silently never worked. The user pai - **Run seed_recipes.py round 4** for the 12 unrun round-1 queries (American + Mediterranean leftovers). - **Backend test infrastructure** — the venv on `docker-willester` is broken. Future sprint when fixed. - **CI integration of Vitest** — `npm test` runs locally but not in CI. + +--- + +## Sprint 16.1 — Lower `_DAILY_LIMIT` 140 → 45 (2026-06-08, follow-up) + +**Why:** the `_DAILY_LIMIT=140.0` in `backend/app/api/recipe_search.py:48` was set assuming Spoonacular's free tier was 150 pts/day. Sprint 15 round 1's `picked_count=0` after 28 queries proved the real cap is **50 pts/day**. The 140 value meant the backend's gate let requests through that Spoonacular then 402'd at the upstream — wasted user-facing time. Sprint 16.1 corrects the gate to 45 (50 - 5pt safety margin). + +**One-line change:** +- `backend/app/api/recipe_search.py:48` — `_DAILY_LIMIT: float = 45.0 # 50 free, leave 5pt safety margin (corrected from 140; Sprint 15 + Sprint 16)` (was `140.0 # 150 free, leave 10pt safety margin`). + +**Verified:** `docker compose up -d --build backend` green. `GET /api/recipes/search?q=test&limit=1` returns 502 (Spoonacular 402 on upstream — expected when at the 50-pt cap). Backend's gate at 45 prevents the user from making a 47th request that would 503 instead of 502. + +**Deploy:** `git pull` + `docker compose up -d --build backend` (no frontend change, no migration). diff --git a/Review/ui-nielsen-audit.md b/Review/ui-nielsen-audit.md index 10a98c7..7223d6f 100644 --- a/Review/ui-nielsen-audit.md +++ b/Review/ui-nielsen-audit.md @@ -159,6 +159,8 @@ The app looks polished on the surface (Tailwind palette, clean cards, working to > > **Sprint 16 status (in progress 2026-06-08, code complete, awaiting commit + push):** Fix Sprint 13 latent bug — every `/api/llm/plan` call has returned `picked_count=0` since 2026-06-05 because `kimi-k2.6:cloud` is a reasoning model that burns the `max_tokens` budget on internal `reasoning` and never produces the JSON answer. The library fill (Sprint 6+) silently took over every time. Discovered by adding a temp debug log and seeing `raw_response=''` with `finish_reason: length`. Two-line fix: `backend/app/config.py:38` switches `OLLAMA_MODEL` from `kimi-k2.6:cloud` to `gpt-oss:20b` (OpenAI's open-source 20B non-reasoning model); `backend/app/api/llm_plan.py:117` bumps `max_tokens` from 800 to 4000 (21 picks × ~100 chars + reasoning = ~2100+ chars; 4000 gives 2x headroom); `backend/.env` (or `docker-compose` env) also updated so the container reads `gpt-oss:20b`. `frontend/src/api/llm.test.ts` (NEW, 4 cases) — Vitest contract test on the LLM response shape. **Live verification:** 5/5 test weeks return `picked_count` 15-21 (was 0 before). **Tracking:** `Review/sprint16-verification.md`. 11/11 tests pass, `npm run build` green. No new runtime deps. No schema change. No UI change. > +> **Sprint 16.1 (2026-06-08):** one-line `_DAILY_LIMIT` follow-up. `backend/app/api/recipe_search.py:48` — `_DAILY_LIMIT: float = 45.0` (was 140.0). The 140 cap assumed Spoonacular free tier was 150 pts/day; Sprint 15 round 1 proved the real cap is 50. The gate now triggers at 45 (5pt safety margin), preventing the user from making requests that would 503 after a 402 upstream roundtrip. Documented in `Review/sprint16-verification.md` (Sprint 16.1 section). +> > > **Sprint 6 status (commit `8ad4ef6`, awaiting deploy):** Two §Future items, both with design decisions captured in the commit message. > - **F3** Bulk 'add checked to pantry' on ShoppingList. Backend `POST /api/pantry/bulk` accepts `{items: HomePantryCreate[]}` and returns per-item status (`added` / `updated` / `skipped`) with totals. Per-item failure model: unknown ingredient → `skipped` with reason, not a 4xx. Frontend ShoppingList gains a primary `Add N to pantry` button next to the existing Reset button; toast reports `added X, updated Y, skipped Z`; only the items that actually landed are removed from the checked Set. **Scope decision:** ShoppingList only (the checked Set was the natural substrate; Pantry would need new multi-select UI). diff --git a/docs/HANDOFF.md b/docs/HANDOFF.md index 72d14a6..98980e5 100644 --- a/docs/HANDOFF.md +++ b/docs/HANDOFF.md @@ -302,7 +302,7 @@ Trust the tests. Trust the live runs. Don't trust prose claims that something is **Current open proposals:** - `docs/proposals/2026-05-23-feedback-driven-recipe-discovery.md` — pending user approval. No code yet (per the 2026-05-23 section below). -**Last updated: 2026-06-08** — UI/UX audit & fix cycle (Sprints 1, 2, 3, 4, 5, 6, 7, 8, 9) complete. 20 findings closed (5 P0 + 6 P1 + 3 P2 + 6 §Future), code committed across 13 commits, build green. Sprint 1 deployed; Sprints 2-9 awaiting deploy. **Sprint 7 (`09c7525`, awaiting user deploy)** aligns "this week" to the upcoming Monday. **Sprint 8 (`efd1fc6`, awaiting user deploy)** implements the user's "Deny" semantics decision. **Sprint 9 (committed 2026-06-05, awaiting user deploy)** ships the F1 Onboarding Tour. **Sprint 10 (committed 2026-06-05, awaiting user deploy)** ships the "Deny Forever" on Recipes. **Sprint 11 (committed 2026-06-05, awaiting user deploy)** wires the dead "Generate Meal Plan" CTA. **Sprint 12 (committed 2026-06-05, awaiting user deploy)** ships the F8 Spoonacular search. **Sprint 13 (committed 2026-06-05, awaiting user deploy)** ships the F9-lite Ollama Cloud plan synthesis. **Sprint 14 (committed 2026-06-05, awaiting user push)** ships Vitest for `useOnboarding` (Q4) — 7/7 tests green. **Sprint 15 (committed 2026-06-06, awaiting user push)** seeds 18 family-friendly recipes and fixes the Sprint 12 latent-bug (`main.py` mount order). **Sprint 15 Round 2 (committed 2026-06-07, awaiting user push)** +18 recipes; library at 67 total. **Sprint 15 Round 3 (committed 2026-06-07, awaiting user push)** +10 recipes; library at 77 total. **Sprint 16 (code complete 2026-06-08, awaiting user commit + push)** switches `OLLAMA_MODEL` from `kimi-k2.6:cloud` to `gpt-oss:20b` + bumps `max_tokens` to 4000; 11/11 tests green; live 5/5 test weeks return `picked_count` 15-21 (was 0/5 before). See Sprint 7 + Sprint 8 + Sprint 9 + Sprint 10 + Sprint 11 + Sprint 12 + Sprint 13 + Sprint 14 + Sprint 15 + Sprint 16 sections below. Full UI-audit handoff at `Review/handoff-ui-audit.md`. +**Last updated: 2026-06-08** — UI/UX audit & fix cycle (Sprints 1, 2, 3, 4, 5, 6, 7, 8, 9) complete. 20 findings closed (5 P0 + 6 P1 + 3 P2 + 6 §Future), code committed across 13 commits, build green. Sprint 1 deployed; Sprints 2-9 awaiting deploy. **Sprint 7 (`09c7525`, awaiting user deploy)** aligns "this week" to the upcoming Monday. **Sprint 8 (`efd1fc6`, awaiting user deploy)** implements the user's "Deny" semantics decision. **Sprint 9 (committed 2026-06-05, awaiting user deploy)** ships the F1 Onboarding Tour. **Sprint 10 (committed 2026-06-05, awaiting user deploy)** ships the "Deny Forever" on Recipes. **Sprint 11 (committed 2026-06-05, awaiting user deploy)** wires the dead "Generate Meal Plan" CTA. **Sprint 12 (committed 2026-06-05, awaiting user deploy)** ships the F8 Spoonacular search. **Sprint 13 (committed 2026-06-05, awaiting user deploy)** ships the F9-lite Ollama Cloud plan synthesis. **Sprint 14 (committed 2026-06-05, awaiting user push)** ships Vitest for `useOnboarding` (Q4) — 7/7 tests green. **Sprint 15 (committed 2026-06-06, awaiting user push)** seeds 18 family-friendly recipes and fixes the Sprint 12 latent-bug (`main.py` mount order). **Sprint 15 Round 2 (committed 2026-06-07, awaiting user push)** +18 recipes; library at 67 total. **Sprint 15 Round 3 (committed 2026-06-07, awaiting user push)** +10 recipes; library at 77 total. **Sprint 16 (code complete 2026-06-08, awaiting user commit + push)** switches `OLLAMA_MODEL` from `kimi-k2.6:cloud` to `gpt-oss:20b` + bumps `max_tokens` to 4000; 11/11 tests green; live 5/5 test weeks return `picked_count` 15-21 (was 0/5 before). **Sprint 16.1 (2026-06-08, awaiting user commit + push)** — one-line `_DAILY_LIMIT` 140 → 45 in `recipe_search.py:48` (corrects the Spoonacular free-tier cap from 150 to 50, with 5pt safety margin). See Sprint 7 + Sprint 8 + Sprint 9 + Sprint 10 + Sprint 11 + Sprint 12 + Sprint 13 + Sprint 14 + Sprint 15 + Sprint 16 sections below. Full UI-audit handoff at `Review/handoff-ui-audit.md`. --- @@ -499,7 +499,7 @@ Plus `frontend/src/api/llm.test.ts` (NEW, 4 cases) — Vitest contract test on t **§Future backlog status after Sprint 16:** F1 ✓, F8 ✓, F9-lite ✓, Q4 ✓. Only F9-full (local Ollama model pull) remains — opt-in based on cloud-billing feedback. The `_ask_llm` helper is still the single seam: F9-full only needs to swap the URL + model name. -**Tracking docs:** `Review/sprint16-verification.md` (full diagnosis + 2-line fix + 4-test contract + live verification + 5-risk table + 4 follow-up tickets), `Review/ui-nielsen-audit.md` Sprint 16 status block, `fix-ui-audit.md` T9.1-T9.5, `Review/handoff-ui-audit.md` Sprint 16 section + Batch L, this file. +**Tracking docs:** `Review/sprint16-verification.md` (full diagnosis + 2-line fix + 4-test contract + live verification + 5-risk table + 4 follow-up tickets + Sprint 16.1 one-line `_DAILY_LIMIT` fix), `Review/ui-nielsen-audit.md` Sprint 16 status block + 16.1 follow-up, `fix-ui-audit.md` T9.1-T9.6, `Review/handoff-ui-audit.md` Sprint 16 section + Batch L + 16.1 TL;DR line, this file. --- diff --git a/fix-ui-audit.md b/fix-ui-audit.md index 74db5f8..a66c2f9 100644 --- a/fix-ui-audit.md +++ b/fix-ui-audit.md @@ -915,3 +915,12 @@ All five go under `devDependencies`. Runtime bundle size unchanged (503.82 kB be - Lower `_DAILY_LIMIT=140` to 45 (S15 follow-up, still pending). - Backend test infrastructure (venv on `docker-willester` is broken). - CI integration of Vitest tests. + +### T9.6 · Sprint 16.1 (2026-06-08): one-line `_DAILY_LIMIT` fix + +**File:** `backend/app/api/recipe_search.py:48` — `_DAILY_LIMIT: float = 45.0` (was 140.0). Comment updated to reference Sprint 15 + Sprint 16 corrections. + +- **Why:** the 140 cap was set assuming Spoonacular free tier is 150 pts/day. Sprint 15 round 1 hit the real cap (50 pts/day) at query 28. The 140 gate let 50+ requests through to the upstream before 503'ing, wasting user time. +- **Fix:** gate at 45 (5pt safety margin under the real 50-pt cap). +- **Verified:** backend rebuilds, search returns 502 (Spoonacular 402 upstream) when at the cap. The gate now triggers correctly. +- No pre-existing WIP files touched. No new runtime dependencies. No migration.