[PR #36] The Second Agent-Led Work: Password Recovery
- What changed: The password recovery work was given to an overnight run. The scope is checking the recovery code, setting a new password, and clearing login wait records.
- Decision: One lock order was fixed (the user row first, then the code row), and the places where the run would stop were removed in advance.
- Still unknown: A gap in the user experience that the plan did not cover is not caught by tests that only follow the plan. It has to be found by following the real flow on return.
After the first overnight task (PR #34), a second one was handed over. The scope was password recovery: confirm a recovery code, set a new password, end all previous logins, and record the event. This post records how writing the work order changed, and how a gap the overnight work did not catch was found.
What was done and why
- Before writing the work order, each test line in the plan was matched against the current code, one line at a time. As a result, there were no stop points left at night. A blank field from the first night, the commit author, was also filled in ahead of time.
- The work was split into two rounds. The first round wrote the tests, and the second implemented them. The tests were written by Claude Haiku 5.5, and the implementation by ChatGPT (Codex, model gpt-6-luna). Both names come from the self-report in the work record and the server configuration.
- Each round took a few minutes, and nothing stopped.
Options chosen and rejected
- Clear the login-wait record together with the reset. People who forget a password often reset while their login is already locked after several wrong tries. In a temporary test, after five wrong tries, a reset with a new password still left the new password blocked. From the user’s side it looks broken. The wait record for that number is now cleared in the same operation. A person with a recovery key could already change the password, so security does not get weaker. I chose this option.
- Rejected: leave it alone and explain it in the app. The user has no reason to wait.
- One lock order was fixed. The user row is locked first, then the code row. This matches the order used when issuing codes, so two requests cannot wait on each other.
How it was checked
- Before the implementation, the seven new tests were committed alone, and all seven failed as expected.
- After the implementation, the full check passed in one run. Unlike the first night, nothing needed fixing on return.
- All six test lines in the plan were confirmed present. This included the check that an old key is refused and that no password or code text is left in the history.
- The login-wait fix was confirmed with a new test that failed before the fix and passed after it.
Lessons
- Matching each test line in the plan against the current code removes stop points before the night begins.
- A gap in the user experience that the plan did not cover is not caught by tests that follow the plan. It only shows up when the real flow is traced on return.
- One blank field in the work order stops overnight work, so the values it needs should be filled in ahead of time.