Add validation, deterministic AI generation, Supabase reconciliation, E2E harness, and observability - #17
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5b8caaa616
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return ( | ||
| <div className="max-w-xl mx-auto p-6 bg-red-50 dark:bg-red-900/20 rounded-lg"> | ||
| <p className="text-red-600 dark:text-red-400">The saved meal plan is invalid. Generate a new plan to continue.</p> | ||
| </div> |
There was a problem hiding this comment.
Keep regeneration available for invalid meal plans
When an existing meal plan fails the new strict parser, this early return removes the New Plan button even though the message tells the user to generate one. Because getMeal() returns existing records without regenerating, any user with a malformed or legacy saved meals value is stuck on this error screen until the database row is manually changed; keep the regenerate action visible here or trigger regeneration for invalid saved plans.
Useful? React with 👍 / 👎.
Motivation
Description
app/lib/date.ts,app/lib/profile.ts,app/lib/auth.ts,app/lib/generated-plans.ts,app/lib/definitions.ts,app/lib/profile-options.ts, and associated schema/type updates.app/lib/workout-generator.ts,app/protected/profile/meal-plan/action.ts,app/lib/e2e-ai-fixtures.ts, andapp/lib/generated-plans.ts; useupsert/rpcand validate OpenAI responses before storing.app/lib/logger.ts,GET /api/healthandGET /api/readinessendpoints, improved error logging across layout/middleware/handlers, and safer auth callback handling withgetSafeRedirectPath.supabase/migrations/20260611170000_reconcile_fitness_schema.sql,supabase/preflight/...,app/lib/database.types.ts,supabase/config.toml, plus typed Supabase client/middleware/server helpers and cookie handling improvements inutils/supabase/*.ts.NavBarimage ->next/image,WorkoutTemplatesdate plumbing, WeeklyProgress date range keys).scripts/check-env.mjs,playwright.config.ts, Playwright tests ine2e/,package.jsonscripts,.github/workflows/quality.yml, and test runner/TypeScript configs..env.exampleand.gitignoreupdated to document env usage and ignore artifacts.Testing
tests/*.test.tsand rannpm testlocally; unit tests passed.npm run lintandnpm run typecheck, and a production build withnpm run build; these succeeded..github/workflows/quality.yml) runsnpm run env:check,npm run check,npm run build, andnpm run test:e2eand uploads Playwright artifacts on failure.Codex Task