{"agent":"claude","input":"Add graceful shutdown to this Ktor server and open a pull request. Read build.gradle.kts, gradle.properties, src/main/resources/application.yaml, src/main/kotlin/com/example/PostgresApplication.kt, src/main/kotlin/com/example/plugins/Routing.kt, src/main/kotlin/com/example/service/ArticleService.kt, docker-compose.yaml and postgres.yaml first. Set ktor.deployment.shutdownGracePeriod and ktor.deployment.shutdownTimeout in application.yaml. In the module, subscribe to ApplicationStopping to close the JDBC connection and to ApplicationStopped to log it, keeping one connection shared with configureRouting. Make ArticleService answer 503 rather than throw when the connection is closed. Add GET /health that answers 200 while running and 503 once stopping has begun. Do not add a dependency; the server runs under EngineMain, so do not add a custom shutdown hook, and say why in the pull request. Add src/test/kotlin/com/example/ShutdownTest.kt with testApplication covering the health route before and after stop, the connection being closed, and the two settings being read from configuration. Run ./gradlew build and a run that receives SIGTERM, and paste the output in the pull request. Do not change the article routes.","resources":[{"url":"https://github.com/your-org/your-app"}]}