Goal
Implement Stage 2 of the API v2-alpha migration plan: add a FastAPI ASGI shell that can host the existing Flask API through WSGI fallback without changing the public API contract.
Targets
- Add a FastAPI ASGI entrypoint.
- Mount the existing Flask app behind FastAPI with WSGI middleware.
- Preserve representative v1 behavior through fallback, including status codes, bodies, headers, CORS, cookies, and country-ID validation.
- Add a native
/health endpoint under ASGI.
- Keep production traffic on App Engine/Flask for this PR.
- Avoid schema, database, Supabase, Cloud Run, and native route migration changes.
Additional compatibility work
- Handle budget-window submission-time Modal 4xx validation errors as structured budget-window error results, so staging can tolerate the newer simulation gateway validation behavior while preserving 5xx failures as real errors.
Success criteria
- Existing representative v1 route contracts pass through both Flask direct and FastAPI fallback clients.
/health returns 200 under ASGI.
- Existing Flask readiness/liveness routes still fall through unchanged.
- No production traffic shift is introduced by this PR.
Goal
Implement Stage 2 of the API v2-alpha migration plan: add a FastAPI ASGI shell that can host the existing Flask API through WSGI fallback without changing the public API contract.
Targets
/healthendpoint under ASGI.Additional compatibility work
Success criteria
/healthreturns200under ASGI.