## Turn 1

*   `store.py`: `save_user` normalizes email (strip, lower), but `get_user` does not.
    *   `routes.py`: `login` calls `get_user` with the raw input email.
    *   Problem: If a user registers with " User@Example.com ", they are stored as "user@example.com". If they login with "User@Example.com", `get_user` looks for "User@Example.com" and fails.

    *   Option A: Normalize in `save_user` and `get_user` (Consistency in storage).
    *   Option B: Normalize in `login` (Consistency in input).
    *   Option C: Normalize in `get_user` (Consistency in retrieval).

    *Best Practice:* Normalize at the point of entry/retrieval to ensure the lookup key matches the storage key. Since `save_user` already normalizes, `get_user` must also normalize to ensure consistency.

    *   `store.py`: Update `get_user` to include `.strip().lower()`.
    *   `routes.py`: No changes needed if `get_user` is fixed, but it's safer to ensure the logic is consistent. However, the prompt asks for a *concise* patch. Fixing `get_user` is the most direct fix for the logic error.

    *   `store.py`:
        ```python
        def get_user(email):
            return USERS.get(email.strip().lower())
        ```

    *   Test Case: Register " User@Example.com ", login with "User@Example.com".

    *   File/Function edits.
    *   One regression test.

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

    *Regression Test:*
    ```python
    def test_login_normalization():
        save_user("  User@Example.com  ", "hash123")
        assert login("User@Example.com", "hash123") is True
    ```

    *Wait, let's check the `routes.py`.*
    `login` calls `get_user(email)`. If `get_user` is fixed, `login` works.

    *Alternative:* Fix `get_user` in `store.py`.

    *Wait, is there a better way?*
    Usually, normalization should happen as early as possible. But since `save_user` already does it, `get_user` is the missing link.

    *Patch Plan:*
    1. `store.py`: Update `get_user` to normalize the input email.

    *Regression Test:*
    Register "  Alice@Example.com  ", login with "alice@example.com".

    *Final check of the prompt:* "Return a concise patch plan with exact file/function edits and one regression test."

    *Drafting the response:*
    `store.py`:
    ```python
    def get_user(email):
        return USERS.get(email.strip().lower())
    ```

    *Regression Test:*
    ```python
    def test_login_case_insensitivity():
        save_user("  User@Example.com  ", "secret")
        assert login("User@Example.com", "secret") == True
    ```