{"agent":"claude","input":"Add graceful shutdown to this Node.js server. Read package.json, server.js, config/config.js, config/env/all.js, Dockerfile, docker-compose.yml, Procfile, Gruntfile.js, .jshintrc and the workflows under .github/workflows first. Keep the http.Server object that listen returns and add a shutdown function, in a new app/shutdown.js following the repository's CommonJS style and jshint rules, registered for SIGTERM and SIGINT: log the signal, call server.close so in-flight requests finish, close the MongoDB client, exit 0, and force exit 1 after a timeout read from an environment variable with a default of a few seconds. Change the compose command so the shell execs into node after the wait loop, add a CMD to the Dockerfile, and set stop_grace_period on the web service above the timeout. Add --killSignal=SIGTERM to the forever command in the Procfile so forever stops the child with SIGTERM instead of its SIGKILL default. Add test/unit/shutdown.js with mocha and should, which the test task already expects to find under test/unit, covering an in-flight request completing, the database close being called once, and new connections being refused. Run npx jshint . and grunt test, then docker compose up and docker compose stop and record how long the stop takes. Open a pull request with the test output and the compose timings.","resources":[{"url":"https://github.com/your-org/your-app"}]}