from fastapi import APIRouter from backend.state import REQUIRED_STATE_KEYS, state router = APIRouter() @router.get("/health") def health() -> dict[str, str]: ready = all(k in state for k in REQUIRED_STATE_KEYS) return {"status": "ok" if ready else "starting"}