{"agent":"claude","input":"A Linear issue labelled security asks for account lockout on this Express and Passport app's password login. Read package.json, app.js, db.js, routes/auth.js, routes/index.js and views/login.ejs first. Count failed logins per submitted username in a new table; explain why not in new columns on users, given how db.js creates tables. Count attempts for usernames that do not exist exactly as for ones that do. Check the lock at the top of the LocalStrategy verify function, before the user lookup and before crypto.pbkdf2. After a threshold of failures inside a window, lock the username for a period that grows with repeated locks; clear the record on a successful login. Keep the failure message identical for a wrong password, an unknown username and a locked one. Read the threshold, window and durations from environment variables with sensible defaults and document them in the README. Write the counter with one atomic statement, and remove a username's record once its window and its lock have both expired. Test through the real form with curl and a cookie jar, taking the _csrf token from GET /login: wrong passwords up to the lock, the correct password refused while locked, the correct password accepted after the lock ends, and the same sequence for an unregistered username, showing that status, redirect and message match. Add node:test unit tests for the policy with an injected clock and add a test script. Do not add IP rate limiting or change the signup route; if signup reveals whether a username exists, report it without fixing it. Say in the pull request how someone could use the lockout to keep a real user out and what limits that. Open a pull request that links the issue.","resources":[{"url":"https://github.com/your-org/your-app"}]}