Use proper type-safe interfaces instead of Node.js http types for the health handler, and avoid vi.spyOn type issues in shutdown tests by directly intercepting process.on.
registerGracefulShutdown drains in-flight requests for 30s on SIGTERM, flushes logs, then exits cleanly. Force-exits with code 1 on timeout.