{"agent":"claude","input":"Make the multi-document writes in this Express and Mongoose API atomic. Read package.json, yarn.lock, src/services/auth.service.js, src/services/token.service.js, src/services/user.service.js, src/controllers/auth.controller.js, src/models/token.model.js, src/models/user.model.js, src/config/config.js, tests/utils/setupTestDB.js, tests/integration/auth.test.js, tests/integration/user.test.js, jest.config.js, .travis.yml and docker-compose.yml first. Thread a session parameter through saveToken, generateAuthTokens and updateUserById, and wrap refreshAuth, resetPassword, verifyEmail, register and deleteUserById in mongoose.startSession() with session.withTransaction, ending the session in a finally. Make deleteUserById also delete that user's Token documents inside the same transaction. Transactions need a replica set: add mongodb-memory-server as a dev dependency and change setupTestDB to start a MongoMemoryReplSet in beforeAll and stop it in afterAll; add --replSet rs0 to the mongodb service in docker-compose.yml and document rs.initiate() in the README. Add tests that force the second write to fail and assert the first was rolled back. Run yarn lint and yarn test and open a pull request that quotes the output.","resources":[{"url":"https://github.com/your-org/your-app"}]}