Review source
Round 14 (Opus 4.8 + Gemini) — P0/P1. Startup gate is bypassable, readiness probe lies.
Problem
- startup_errors() runs only in backend/main.py. Running uvicorn backend.src.api.app:app (the standard ASGI invocation that DEPLOYMENT docs reference for workers) skips ALL production config validation. You can boot in production mode with placeholder secrets and demo endpoints on.
- /readiness (health.py:87) only validates runtime config, not DB or Redis. A pod with a dead database reports ready and takes traffic. The DB check lives in /health (liveness), which is backwards — liveness failure restarts the pod instead of draining it.
Fix
- Call startup_errors() inside the app lifespan (app.py) so it fails fast regardless of entrypoint
- Move DB + Redis connectivity check from /health into /readiness; /readiness returns 503 when either is down
- /health (liveness) should only check the process is alive, not dependencies
Acceptance Criteria
- Booting via uvicorn ...app:app with placeholder secrets in production mode fails at startup
- /readiness returns 503 when DB is down
- /readiness returns 503 when Redis is down
- /health stays 200 even when DB is down (liveness vs readiness)
- mypy clean, ruff clean, tests >= baseline
Review source
Round 14 (Opus 4.8 + Gemini) — P0/P1. Startup gate is bypassable, readiness probe lies.
Problem
Fix
Acceptance Criteria