As is often the case, I agree with Eric and find myself with little to add beyond a +1 to the position Eric suggested :-)
mypy's current heuristics are similar to pyright's, except that simple assignments in nested scope are considered variables, not aliases (as Nipunn mentioned,
relevant code). With PEP 613, I personally don't feel particularly strongly about that additional heuristic... Although maybe there is an appeal to be made to Chesterton's Fence, given that Ivan and Jukka went out of their way to include that heuristic, even though the pre-PEP 613 world left users no recourse to get mypy to treat those as type aliases. I'll check how much code gets flagged by mypy_primer if I remove it.
Both of you are right that consistency is better for users. I did a bad job of expressing the core of the point I wanted to make, which was something like: if the intent of the user is clear (as the case of `def f(): X: TypeAlias = int` feels to me), I tend to default to the position that type checkers should follow that intent and it shouldn't be prohibited without a discussion like the one we're having now :-)
If we find we're in agreement / this thread dies off, I think I have the following action items:
1) Make PRs to clarify PEP 484 and loosen requirements in PEP 613
2) See if changing mypy's heuristic regarding nested scopes to match pyright causes regressions for mypy users
3) Update the mypy documentation page Nipunn linked