## Turn 1

*   `store.py`:
        *   `save_user(email, password_hash)`: Normalizes email using `.strip().lower()`.
        *   `get_user(email)`: Does *not* normalize the email.
    *   `routes.py`:
        *   `login(email, password_hash)`: Calls `get_user(email)`.
    *   Problem: If a user registers with "User@Example.com", it's stored as "user@example.com". If they login with "User@Example.com", `get_user` looks for the exact string, fails to find the normalized key, and login fails.

    *   The normalization should happen at the point of retrieval to match the point of storage.
    *   Alternatively, normalization could happen at the entry point (the route), but it's safer to ensure the data access layer (`get_user`) handles the normalization consistently with how `save_user` handles it.

    *   *Option A (Modify `get_user`):* Normalize the input inside `get_user`. This is the most robust fix because it ensures any lookup (not just login) is consistent.
    *   *Option B (Modify `login`):* Normalize the input inside `login`. This works but leaves `get_user` inconsistent.

    *Decision:* Modify `get_user` in `store.py` to match the logic in `save_user`.

    *   `store.py`:
        *   `get_user(email)`: Change `USERS.get(email)` to `USERS.get(email.strip().lower())`.

    *   Need a test case where an email with whitespace or mixed casing is used for login after being saved.

    *   *Patch Plan:*
        *   `store.py`: Update `get_user` to normalize the email.
    *   *Regression Test:*
        *   Register " USER@Example.com "
        *   Login with "user@example.com" (should succeed).

    *   Concise patch plan? Yes.
    *   Exact file/function edits? Yes.
    *   One regression test? Yes.

    *Refining the patch:*
    `store.py`
    `get_user(email)`:
    `return USERS.get(email.strip().lower())`

    *Refining the test:*
    `save_user("  User@Example.com  ", "hash")`
    `login("user@example.com", "hash")` -> True

    Wait, the prompt asks for a "concise patch plan".

    *Patch:*
    `store.py` -> `get_user`
    Change: `USERS.get(email)` to `USERS.get(email.strip().lower())`

    *Regression Test:*
    Register: `save_user("  User@Example.com  ", "hash")`
    Login: `login("user@example.com", "hash")` should return `True`.