feat(meals): enforce three lower-calorie dinners with media
CI / backend (pytest + alembic) (push) Canceled after 0s
CI / frontend (build) (push) Canceled after 0s

This commit is contained in:
2026-09-01 10:11:36 -07:00
parent 7838c49721
commit 2695ba0232
85 changed files with 8103 additions and 795 deletions
+81
View File
@@ -745,3 +745,84 @@ Round 1 (Sprint 15) imported 18 recipes before hitting the 50-pt/day free-tier c
- **Adding more reasoning to the prompt** (e.g. chain-of-thought). gpt-oss returns valid JSON without needing it.
- **Per-model prompt templates.** One prompt works for both kimi-k2 and gpt-oss; the model switch alone is the fix.
- **Re-trying F9-full** (local Ollama model pull). Still opt-in based on cloud-billing feedback. `_ask_llm` is still the single seam.
## Recipe Catalog Import (2026-08-14)
**Status:** Complete. All five approved phases are implemented and verified within scope.
- [x] Phase 1: staging/provenance model, migration, and focused persistence tests.
- [x] Phase 2: Wikibooks fetch, normalization, checksum, validation, and fixture tests.
- [x] Phase 3: admin review and atomic publish API with auth/state-transition tests.
- [x] Phase 4: acquisition cutover plus existing-catalog audit/quarantine tooling.
- [x] Phase 5: licensing/operations docs and full backend verification.
Canonical task plan: `recipe-catalog-import.md`.
## Wikibooks Live Compatibility (2026-08-15)
**Status:** Complete. Production generation recovered through the licensed staging workflow.
- [x] Correct live title-token false positives without relaxing quantity or serving checks.
- [x] Add bounded, checksum-verified revalidation for unreviewed Wikibooks candidates.
- [x] Verify with 36 offline tests and 55 disposable-PostgreSQL tests.
- [x] Deploy backend and scheduler to `docker-willester`.
- [x] Approve one reviewed dinner recipe and verify the original Generate endpoint persists it.
Canonical task plan: `wikibooks-live-compatibility.md`.
## Production Recipe Replacement (2026-08-16)
**Status:** Complete. Production now has 50 bundled starter recipes plus the approved Rigatoni recipe.
- [x] Audit production deletion impact: 82 hidden legacy recipes are referenced by 792 historical meal-plan items.
- [x] Stop and remove the bounded Wikibooks batch after its live acceptance rate could not safely produce 50 recipes.
- [x] Add 50 original bundled recipes and an atomic, advisory-locked, idempotent loader.
- [x] Verify with 3 offline tests and 79 focused disposable-PostgreSQL tests; compilation and scoped diff checks passed.
- [x] Back up production at `backups/recipe-replacement-20260816-093724.dump`.
- [x] Load the 50 bundled recipes, clean 484 abandoned unreviewed staging rows, and verify 51 active recipes total.
Canonical task plan: `replace-production-recipes.md`.
## Friday Email Catalog Filter (2026-08-23)
**Status:** Complete and deployed.
- [x] Trace proposal, reminder, and finalization recipe rendering.
- [x] Filter all three paths to active recipes without changing historical records or APIs.
- [x] Add mixed active/quarantined regression coverage for each email.
- [x] Verify compilation, scoped diff checks, and 17 focused PostgreSQL tests.
- [x] Rebuild and recreate the production backend and scheduler containers; verify health and loaded runtime source.
Canonical task plan: `friday-email-catalog-filter.md`.
## Lower-Calorie Recipe Catalog (2026-08-27)
**Status:** Completed and verified in production.
- [x] Recalculate and reformulate all affected bundled recipes to an estimated maximum of 500 kcal per serving.
- [x] Add a safe in-place bundled-catalog update path that preserves recipe IDs and history.
- [x] Add durable operator quarantine behavior for the Wikibooks Rigatoni recipe.
- [x] Verify Phase 1 against disposable PostgreSQL.
- [x] Back up and deploy the atomic update and Rigatoni quarantine to production.
Canonical task plan: `lower-calorie-recipe-catalog.md`.
## Three-Dinner Planner Routing (2026-08-31)
**Status:** Complete; one-time approval covered implementation and verification.
- [x] Trace Dashboard, library-fill, LLM, and canonical planner generation paths.
- [x] Add regressions for exactly three active, calorie-eligible dinners on days 1/3/5.
- [x] Route user-facing bulk generation through the canonical planner and remove seven-dinner fallback behavior.
- [x] Prevent persisted planner overrides from increasing the three-dinner set size.
- [x] Run focused backend/frontend verification and inspect the scoped diff.
## Three-Dinner Meal Media (2026-09-01)
**Status:** Complete; one-time approval covered tests, implementation, production enrichment, deployment, and verification.
- [x] Trace live recipe image and calorie fields through catalog, API, and Dashboard.
- [x] Add regressions for calorie display, ingress-safe local images, and image provenance.
- [x] Render calories on meal cards/details and resolve local static image paths correctly.
- [x] Generate and persist OpenAI images for the current three active dinners only.
- [x] Verify tests/build, deploy affected services, and confirm the live current-week response.