{"agent":"claude","input":"Add graceful shutdown to this Litestar application. Read src/py/app/server/asgi.py, src/py/app/server/core.py, src/py/app/server/plugins.py, src/py/app/lib/settings.py, src/py/app/lib/worker.py, src/py/app/domain/system/controllers.py, tools/deploy/docker/Dockerfile, Dockerfile.worker and docker-compose.yml, and uv.lock for the granian and litestar versions. Add an on_shutdown handler in ApplicationCore.on_app_init that sets a draining flag on app.state first and logs shutdown_started; make /health answer 503 while draining. Do not add a second engine dispose: advanced-alchemy already disposes the engine. Set GRANIAN_WORKERS_KILL_TIMEOUT in both Dockerfiles and add stop_grace_period to the app and worker services in docker-compose.yml, longer for the worker because SAQ cron jobs run with timeout=600. Add a TestClient unit test for the flag and the log line, and an integration test that starts litestar run as a subprocess, sends SIGTERM during a slow request, and asserts the response completes and the process exits 0. Run make test and open a pull request with the output and the new environment variables listed.","resources":[{"url":"https://github.com/your-org/your-app"}]}