Files
Meal-Planner/replace-production-recipes.md
admin 2695ba0232
CI / backend (pytest + alembic) (push) Canceled after 0s
CI / frontend (build) (push) Canceled after 0s
feat(meals): enforce three lower-calorie dinners with media
2026-09-01 10:11:36 -07:00

2.0 KiB

Replace Production Recipe Catalog

Goal

Replace the visible legacy catalog with 50 complete, app-owned starter recipes without breaking historical meal plans.

Phase 1: Bundled Starter Catalog

  • Remove the abandoned one-off Wikibooks bulk command and its batch-only service code.
  • Add 50 original recipes with explicit servings, times, quantified ingredients, and substantive instructions.
  • Add an idempotent operator loader that creates exact canonical ingredients and active global recipes in one transaction.
  • Validate recipe count, unique names, quantities, instructions, safety endpoints, and database idempotency.
  • Verify offline and against disposable PostgreSQL (79 passed).

Phase 2: Production Replacement

  • Back up the production database before mutation (backups/recipe-replacement-20260816-093724.dump).
  • Rebuild the backend and load exactly 50 bundled recipes.
  • Keep all 82 legacy recipes quarantined and invisible rather than deleting rows referenced by 792 historical meal-plan items.
  • Remove 484 unreviewed staging rows while preserving the approved Rigatoni provenance row.
  • Verify active count, bundled marker, generation, historical references, and absence of legacy recipes from catalog selection.

Done When

  • Production has the existing approved Rigatoni recipe plus exactly 50 bundled starter recipes.
  • No quarantined legacy recipe is selectable.
  • Historical meal-plan references remain intact.
  • A backup and machine-readable operation report exist.

Abandoned Wikibooks Batch

The bounded Wikibooks run was stopped after 433 pages yielded only 11 valid candidates. It published zero recipes. The bundled catalog replaces this failed source strategy rather than weakening quantity or serving validation.

Destructive Alternative

Physical deletion is excluded because 792 historical meal-plan items reference 82 quarantined recipes. It requires a separate approved data-retention decision to null or remap those historical links.