Developer
Fangyi Zhou
me@fangyi.io
Performance
Key patterns and highlights from this developer's activity.
Breakdown of growth, maintenance, and fixes effort over time.
Bugs introduced vs. fixed over time.
No bugs introduced or fixed in this period.
Reclassifies engineering effort based on bug attribution. Commits that introduced bugs are retrospectively counted as poor investments.
Investment Quality reclassifies engineering effort based on bug attribution data. Commits identified as buggy origins (those that introduced bugs later fixed by someone) have their grow and maintenance time moved into the Wasted Time category. Their waste (fix commits) remains counted as productive. All other commits retain their standard classification: grow is productive, maintenance is maintenance, and waste (fixes) is productive.
The standard model classifies commits as Growth, Maintenance, or Fixes. Investment Quality adds a quality lens: a commit that introduced a bug is retrospectively counted as a poor investment — the engineering time spent on it was wasted because it ultimately required additional fix work. Fix commits (Fixes in the standard model) are reframed as productive, because fixing bugs is valuable work.
Currently computed client-side from commit and bug attribution data. Ideal server-side endpoint:
POST /v1/organizations/{orgId}/investment-quality
Content-Type: application/json
Request:
{
"startTime": "2025-01-01T00:00:00Z",
"endTime": "2025-12-31T23:59:59Z",
"bucketSize": "BUCKET_SIZE_MONTH",
"groupBy": ["repository_id" | "deliverer_email"]
}
Response:
{
"productivePct": 74,
"maintenancePct": 18,
"wastedPct": 8,
"buckets": [
{
"bucketStart": "2025-01-01T00:00:00Z",
"productive": 4.2,
"maintenance": 1.8,
"wasted": 0.6
}
]
}Latest analyzed commits from this developer.
| Hash | Message | Date | Files |
|---|
Commit activity distribution by hour and day of week. Shows when this developer is most active.
Developers who frequently work on the same files and symbols. Higher score means stronger code collaboration.
| Effort |
|---|
| e91f099e | This commit **fixes a bug** in the **`pyrefly` static analysis engine** that prevented it from flagging `TypeError` for union types like `"str" | None` involving string literals. The `is_plain_type` function within the **`ForwardRefUnion` check** in `pyrefly/lib/alt/solve.rs` was updated to correctly identify `Type::None` as a plain type. This **improves the accuracy of type checking** for union operators, preventing potential runtime errors that `pyrefly` should have caught. Comprehensive **new tests** were also added to validate various union scenarios, including `Any`, `TypedDict`, `Literal`, and parameterized generics. | Mar 24 | 2 | waste |
| 6d21b41a | This commit **resolves a CI failure** on the trunk branch by addressing **code formatting issues** within the `pyrefly/lib/stubgen` module. Specifically, it adjusts the style of the `run_stubgen` function call and modifies a string literal in `mod.rs` to prevent it from being incorrectly identified as a generated file header. This **maintenance fix** ensures that the project's continuous integration pipeline remains stable and that code adheres to established formatting standards. The change primarily impacts the **stub generation subsystem**, preventing future CI breaks related to style. | Mar 17 | 1 | maint |
| 85494485 | This commit provides a **bug fix** for the **type resolution logic** within `pyrefly`'s **enum field handling**. It addresses an issue where class methods defined in `Enum` classes were incorrectly identified as enum literals due to a missing type annotation, leading to incorrect type inference. The `get_class_field_type` and `get_enum_class_field_type` functions in `pyrefly/lib/alt/class/class_field.rs` and `pyrefly/lib/alt/class/enums.rs` have been updated to correctly determine if a field is an initialized enum member, including special handling for method-like definitions. This ensures **accurate type inference** for `Enum` classes and prevents misclassification of their members. A new regression test `test_enum_classmethod` was added to verify the fix. | Mar 5 | 3 | waste |
| 3ad801f0 | This commit **fixes a regression** that caused an "invalid-literal" error and incorrect resolution of **type aliases** when `Annotated` types were involved. It updates the **type alias resolution logic** in `pyrefly/lib/alt/solve.rs` to correctly unwrap and process `Annotated` types, preventing them from being treated as `UntypedAlias`. Concurrently, the `is_valid_literal` helper in `pyrefly/lib/alt/specials.rs` is modified to recursively check the inner type of `Annotated` values during **`Literal` validation**. This **bug fix** ensures the `pyrefly` type system accurately handles `Annotated` types, improving the reliability of type checking for complex type definitions. | Mar 4 | 4 | waste |
| a89244a9 | This commit introduces a **new validation rule** to **enforce correct usage of `typing.Final` variables**, raising an error when a `Final` variable is declared without an initial value. It enhances the **`pyrefly` type analysis** by tracking initialization across various assignment forms, including direct assignments, `with` statements, walrus operators, and crucially, recognizing initializations of `Final` class attributes within `__init__` methods. This **feature** ensures stricter adherence to the Python typing specification, improving code correctness and catching potential runtime issues earlier. The changes span across **binding and solving logic** within `pyrefly/lib/alt` and `pyrefly/lib/binding`, with corresponding updates to **conformance and unit tests**. | Mar 4 | 15 | grow |
| 14be156a | This commit **introduces a distinct `Annotated` type case** within the `pyrefly_types` crate, moving beyond treating `Annotated[T, ...]` solely as its base type `T`. This **conformance improvement** addresses spec violations where `Annotated` types were incorrectly accepted as `type` or `TypeAlias` and were callable, which the Python typing specification explicitly disallows. The **type solver** and **attribute resolution** in `pyrefly/lib/alt` are updated to correctly process this new type, and the **type assignment rules** in `pyrefly/lib/solver/subset.rs` now prevent `Annotated` from being assigned to `type` or `TypeAlias`. This ensures **strict adherence to PEP 593** for `Annotated` types, resolving previously failing conformance tests related to qualifiers. | Mar 2 | 10 | grow |
| ae40b15e | This commit performs a **code cleanup** by **removing an unused import statement** from the codebase. This **maintenance** task improves the overall **code quality** and readability, ensuring that only necessary dependencies are declared. By eliminating dead code, it contributes to a leaner and more efficient project structure. This change has a minor positive impact on build times and resource usage across the affected module. | Feb 27 | 2 | – |
| 06cf74b7 | This commit **fixes a bug** in the **type variable scoping checks** within the `pyrefly_types` crate, specifically addressing **false positive errors** that occurred when the `Self` type was used. It modifies the type recursion logic in `crates/pyrefly_types/src/types.rs` to explicitly ignore `SelfType` when checking for type variable references, as `Self` does not surface type variables. This **bug fix** improves the **correctness and usability of the type system** by preventing invalid errors for valid `Self` type usage. A new **regression test** in `pyrefly/lib/test/typing_self.rs` was added to ensure the stability of this fix. | Feb 26 | 2 | waste |
| 0479a07e | This commit **fixes a bug** in the **LSP completion provider** that caused duplicate suggestions when typing `TypedDict` keys within a `.get()` call. It modifies the `add_dict_key_completions` function in `pyrefly/lib/state/lsp/dict_completions.rs` to return a boolean, indicating whether it successfully provided dictionary key completions. This allows the main completion logic in `pyrefly/lib/lsp/wasm/completion.rs` to conditionally skip `add_literal_completions`, preventing redundant `Literal['x']` entries from appearing. The change significantly improves the accuracy and user experience of **code completion** for dictionary and `TypedDict` accessors by eliminating clutter. | Feb 24 | 3 | waste |
| efba20b7 | This commit **fixes a false positive `bad-instantiation` error** in the **type checker** when a **`dataclass` implements a `Protocol`** that declares `__dataclass_fields__`. Previously, the `calculate_abstract_members` function in `pyrefly/lib/alt/class/class_metadata.rs` would incorrectly flag the protocol's `__dataclass_fields__` as abstract because it failed to recognize the dataclass's synthesized, concrete implementation. The **bug fix** modifies `calculate_abstract_members` to first check for synthesized concrete implementations, ensuring that the dataclass's own `__dataclass_fields__` is recognized as satisfying the protocol's requirement. This resolves a **regression** introduced by a prior change that synthesized `__dataclass_fields__` for dataclasses, preventing erroneous type errors and improving the accuracy of **dataclass and protocol type checking**. | Feb 23 | 2 | waste |
| b8b8e0ce | This commit significantly **enhances the Language Server Protocol (LSP) capabilities** within `pyrefly` by improving **code completion** and **signature help** for **overloaded functions**. It introduces a new `filter_compatible_overloads` method to intelligently narrow down suggestions based on already provided positional arguments, ensuring that completions for keyword arguments and literals are drawn from *all compatible overloads* rather than just the closest match. Additionally, this change refines **signature help** to display all relevant overloads with the best match highlighted, and includes a **bug fix** in `expected_call_argument_type` related to overload indexing. These improvements provide a more accurate and comprehensive developer experience when interacting with overloaded functions. | Feb 20 | 5 | maint |
| 0e286da0 | This commit **enhances type checker conformance** by **implementing strict validation for `typing.Self` usage** according to the Python typing specification. It introduces new checks to **raise errors** when `Self` appears in invalid locations: outside a class, within a static method, or inside a metaclass. This involves adding an `is_metaclass` field to `ClassMetadata` and integrating validation logic into `decorate_function_type`, `resolve_self_type_literal`, and `track_potential_typing_self`. The change improves the **accuracy and reliability of type analysis** within the **`pyrefly` type checker** by preventing incorrect `Self` patterns and aligning more closely with the spec. | Feb 17 | 10 | grow |
| d8e14367 | This commit **refines protocol subtyping checks** within the Pyre type checker, specifically addressing how `ClassVar` attributes and dataclass fields are handled. It ensures that `ClassVar` attributes are correctly matched during subtyping for both class objects and instances, and synthesizes `__dataclass_fields` as a `ClassVar` for dataclasses. This **bug fix** and **refinement** improves the accuracy of the **type checker's protocol conformance** logic, leading to **fewer incorrect type errors** and a more robust type system. The changes impact the **core type checking engine** and resolve several long-standing issues, resulting in **7 fewer failing conformance tests**. | Feb 17 | 11 | waste |
| 57d60c73 | This commit **fixes a bug** in the **type inference system** where **generic `__init__` methods** were incorrectly handled when converted to callables, leading to improper type instantiation. It **refactors** the conversion logic within `pyrefly/lib/alt/call.rs` and `pyrefly/lib/alt/function.rs` by introducing `bind_dunder_init_for_callable` and adding a `skip_instantiation` flag to `bind_function`. This ensures that type variables in generic constructors are preserved for later inference, improving the **correctness of type handling for generics** when converting constructors to callable types. The change reduces conformance errors for `constructors_callable.py` and is validated by new and updated test cases in `pyrefly/lib/test/callable.rs` and `pyrefly/lib/test/constructors.rs`. | Feb 13 | 8 | waste |
| a6d9bc12 | This commit introduces a **new type-checking capability** in `pyrefly` to **enforce the `Final` type qualifier specification** for imported variables. It now raises an **error** when an imported name, originally marked as `Final` in its defining module, is subsequently re-assigned in the importing module, aligning with the Python typing specification. This **feature** required extending the **export and binding logic** within `pyrefly/lib/export` and `pyrefly/lib/binding` to track and check the `is_final` status of symbols during name resolution. This enhancement improves the **correctness and adherence to Python's typing specification** for cross-module `Final` variable usage, potentially surfacing **new type errors** in codebases that previously violated this rule. | Feb 13 | 11 | grow |
| e449ae96 | This commit **fixes a critical bug** that caused `scrut` tests, specifically those within the `tensor_shapes` module, to fail due to an undefined `TEST_ROOT` environment variable. It **adds the `TEST_ROOT` environment variable** to the test execution environment within the `_get_env` method of `CargoExecutor` in `test.py`, pointing to `test/tensor_shapes`. Additionally, the GitHub Actions workflow in `.github/workflows/pyrefly.yml` is updated to ensure this variable is consistently set during CI runs. This essential **maintenance fix** resolves ongoing **CI failures** on the main branch, ensuring the stability and correctness of the `scrut` test suite. | Feb 12 | 2 | maint |
| c5da9743 | This commit **updates the documentation** for **agents** by adding a critical note to `AGENTS.md`. It advises users to explicitly run `python3 test.py` when executing tests in **external build environments**, as these setups typically lack the `fbpython` interpreter specified in the `test.py` shebang. This **documentation update** serves as a **maintenance improvement**, clarifying the correct procedure for running **tests** and preventing potential execution failures for external contributors. The change specifically impacts how **tests** are initiated outside of the standard internal build system, ensuring smoother operation. | Feb 12 | 1 | maint |
| 0aebd10d | This commit introduces a **conformance improvement** to the **`pyrefly` type checker's call resolution logic**, specifically addressing how `type[T]` calls are inferred. Previously, such calls inferred a generic callable `() -> T`; now, when `T` is bounded by a class, the system correctly uses the bound class's signature for inference while retaining `T` as the return type. This **enhances the accuracy of type inference for generic constructors**, particularly within the `pyrefly/lib/alt/call.rs` module, by extending `CallTarget::Class` and modifying `resolve_call_target`. While improving type soundness, this change may introduce new type errors in existing codebases due to more precise inference, as reflected by updates to the conformance test suite. | Feb 11 | 6 | maint |
| 592cea81 | This commit **fixes a bug** in `pyrefly`'s **type annotation parsing** by preventing the construction of **invalid union types** that combine string literals (as forward references) with actual types (e.g., `"str" | int`). It introduces new logic in the `pyrefly/lib/alt/solve.rs` and `pyrefly/lib/binding/expr.rs` modules to detect and report these errors, which previously went unnoticed and would lead to runtime failures. This **improves the accuracy of type checking** by ensuring `pyrefly` correctly identifies annotations that would cause runtime failures, leading to a more robust static analysis and passing two additional conformance tests. | Feb 6 | 9 | waste |
| 8efc876a | This commit introduces a **new validation rule** within the `pyrefly` compiler's **binding phase** to **disallow repeated type alias declarations**. Specifically, the logic in `pyrefly/lib/binding/stmt.rs` now detects and reports an error when an attempt is made to redefine an existing type alias, ensuring **type system consistency**. This **conformance improvement** aligns the compiler with language specifications, preventing silent redefinitions, and is verified by new test cases in `pyrefly/lib/test/type_alias.rs`. | Feb 4 | 5 | maint |
This commit **fixes a bug** in the **`pyrefly` static analysis engine** that prevented it from flagging `TypeError` for union types like `"str" | None` involving string literals. The `is_plain_type` function within the **`ForwardRefUnion` check** in `pyrefly/lib/alt/solve.rs` was updated to correctly identify `Type::None` as a plain type. This **improves the accuracy of type checking** for union operators, preventing potential runtime errors that `pyrefly` should have caught. Comprehensive **new tests** were also added to validate various union scenarios, including `Any`, `TypedDict`, `Literal`, and parameterized generics.
This commit **resolves a CI failure** on the trunk branch by addressing **code formatting issues** within the `pyrefly/lib/stubgen` module. Specifically, it adjusts the style of the `run_stubgen` function call and modifies a string literal in `mod.rs` to prevent it from being incorrectly identified as a generated file header. This **maintenance fix** ensures that the project's continuous integration pipeline remains stable and that code adheres to established formatting standards. The change primarily impacts the **stub generation subsystem**, preventing future CI breaks related to style.
This commit provides a **bug fix** for the **type resolution logic** within `pyrefly`'s **enum field handling**. It addresses an issue where class methods defined in `Enum` classes were incorrectly identified as enum literals due to a missing type annotation, leading to incorrect type inference. The `get_class_field_type` and `get_enum_class_field_type` functions in `pyrefly/lib/alt/class/class_field.rs` and `pyrefly/lib/alt/class/enums.rs` have been updated to correctly determine if a field is an initialized enum member, including special handling for method-like definitions. This ensures **accurate type inference** for `Enum` classes and prevents misclassification of their members. A new regression test `test_enum_classmethod` was added to verify the fix.
This commit **fixes a regression** that caused an "invalid-literal" error and incorrect resolution of **type aliases** when `Annotated` types were involved. It updates the **type alias resolution logic** in `pyrefly/lib/alt/solve.rs` to correctly unwrap and process `Annotated` types, preventing them from being treated as `UntypedAlias`. Concurrently, the `is_valid_literal` helper in `pyrefly/lib/alt/specials.rs` is modified to recursively check the inner type of `Annotated` values during **`Literal` validation**. This **bug fix** ensures the `pyrefly` type system accurately handles `Annotated` types, improving the reliability of type checking for complex type definitions.
This commit introduces a **new validation rule** to **enforce correct usage of `typing.Final` variables**, raising an error when a `Final` variable is declared without an initial value. It enhances the **`pyrefly` type analysis** by tracking initialization across various assignment forms, including direct assignments, `with` statements, walrus operators, and crucially, recognizing initializations of `Final` class attributes within `__init__` methods. This **feature** ensures stricter adherence to the Python typing specification, improving code correctness and catching potential runtime issues earlier. The changes span across **binding and solving logic** within `pyrefly/lib/alt` and `pyrefly/lib/binding`, with corresponding updates to **conformance and unit tests**.
This commit **introduces a distinct `Annotated` type case** within the `pyrefly_types` crate, moving beyond treating `Annotated[T, ...]` solely as its base type `T`. This **conformance improvement** addresses spec violations where `Annotated` types were incorrectly accepted as `type` or `TypeAlias` and were callable, which the Python typing specification explicitly disallows. The **type solver** and **attribute resolution** in `pyrefly/lib/alt` are updated to correctly process this new type, and the **type assignment rules** in `pyrefly/lib/solver/subset.rs` now prevent `Annotated` from being assigned to `type` or `TypeAlias`. This ensures **strict adherence to PEP 593** for `Annotated` types, resolving previously failing conformance tests related to qualifiers.
This commit performs a **code cleanup** by **removing an unused import statement** from the codebase. This **maintenance** task improves the overall **code quality** and readability, ensuring that only necessary dependencies are declared. By eliminating dead code, it contributes to a leaner and more efficient project structure. This change has a minor positive impact on build times and resource usage across the affected module.
This commit **fixes a bug** in the **type variable scoping checks** within the `pyrefly_types` crate, specifically addressing **false positive errors** that occurred when the `Self` type was used. It modifies the type recursion logic in `crates/pyrefly_types/src/types.rs` to explicitly ignore `SelfType` when checking for type variable references, as `Self` does not surface type variables. This **bug fix** improves the **correctness and usability of the type system** by preventing invalid errors for valid `Self` type usage. A new **regression test** in `pyrefly/lib/test/typing_self.rs` was added to ensure the stability of this fix.
This commit **fixes a bug** in the **LSP completion provider** that caused duplicate suggestions when typing `TypedDict` keys within a `.get()` call. It modifies the `add_dict_key_completions` function in `pyrefly/lib/state/lsp/dict_completions.rs` to return a boolean, indicating whether it successfully provided dictionary key completions. This allows the main completion logic in `pyrefly/lib/lsp/wasm/completion.rs` to conditionally skip `add_literal_completions`, preventing redundant `Literal['x']` entries from appearing. The change significantly improves the accuracy and user experience of **code completion** for dictionary and `TypedDict` accessors by eliminating clutter.
This commit **fixes a false positive `bad-instantiation` error** in the **type checker** when a **`dataclass` implements a `Protocol`** that declares `__dataclass_fields__`. Previously, the `calculate_abstract_members` function in `pyrefly/lib/alt/class/class_metadata.rs` would incorrectly flag the protocol's `__dataclass_fields__` as abstract because it failed to recognize the dataclass's synthesized, concrete implementation. The **bug fix** modifies `calculate_abstract_members` to first check for synthesized concrete implementations, ensuring that the dataclass's own `__dataclass_fields__` is recognized as satisfying the protocol's requirement. This resolves a **regression** introduced by a prior change that synthesized `__dataclass_fields__` for dataclasses, preventing erroneous type errors and improving the accuracy of **dataclass and protocol type checking**.
This commit significantly **enhances the Language Server Protocol (LSP) capabilities** within `pyrefly` by improving **code completion** and **signature help** for **overloaded functions**. It introduces a new `filter_compatible_overloads` method to intelligently narrow down suggestions based on already provided positional arguments, ensuring that completions for keyword arguments and literals are drawn from *all compatible overloads* rather than just the closest match. Additionally, this change refines **signature help** to display all relevant overloads with the best match highlighted, and includes a **bug fix** in `expected_call_argument_type` related to overload indexing. These improvements provide a more accurate and comprehensive developer experience when interacting with overloaded functions.
This commit **enhances type checker conformance** by **implementing strict validation for `typing.Self` usage** according to the Python typing specification. It introduces new checks to **raise errors** when `Self` appears in invalid locations: outside a class, within a static method, or inside a metaclass. This involves adding an `is_metaclass` field to `ClassMetadata` and integrating validation logic into `decorate_function_type`, `resolve_self_type_literal`, and `track_potential_typing_self`. The change improves the **accuracy and reliability of type analysis** within the **`pyrefly` type checker** by preventing incorrect `Self` patterns and aligning more closely with the spec.
This commit **refines protocol subtyping checks** within the Pyre type checker, specifically addressing how `ClassVar` attributes and dataclass fields are handled. It ensures that `ClassVar` attributes are correctly matched during subtyping for both class objects and instances, and synthesizes `__dataclass_fields` as a `ClassVar` for dataclasses. This **bug fix** and **refinement** improves the accuracy of the **type checker's protocol conformance** logic, leading to **fewer incorrect type errors** and a more robust type system. The changes impact the **core type checking engine** and resolve several long-standing issues, resulting in **7 fewer failing conformance tests**.
This commit **fixes a bug** in the **type inference system** where **generic `__init__` methods** were incorrectly handled when converted to callables, leading to improper type instantiation. It **refactors** the conversion logic within `pyrefly/lib/alt/call.rs` and `pyrefly/lib/alt/function.rs` by introducing `bind_dunder_init_for_callable` and adding a `skip_instantiation` flag to `bind_function`. This ensures that type variables in generic constructors are preserved for later inference, improving the **correctness of type handling for generics** when converting constructors to callable types. The change reduces conformance errors for `constructors_callable.py` and is validated by new and updated test cases in `pyrefly/lib/test/callable.rs` and `pyrefly/lib/test/constructors.rs`.
This commit introduces a **new type-checking capability** in `pyrefly` to **enforce the `Final` type qualifier specification** for imported variables. It now raises an **error** when an imported name, originally marked as `Final` in its defining module, is subsequently re-assigned in the importing module, aligning with the Python typing specification. This **feature** required extending the **export and binding logic** within `pyrefly/lib/export` and `pyrefly/lib/binding` to track and check the `is_final` status of symbols during name resolution. This enhancement improves the **correctness and adherence to Python's typing specification** for cross-module `Final` variable usage, potentially surfacing **new type errors** in codebases that previously violated this rule.
This commit **fixes a critical bug** that caused `scrut` tests, specifically those within the `tensor_shapes` module, to fail due to an undefined `TEST_ROOT` environment variable. It **adds the `TEST_ROOT` environment variable** to the test execution environment within the `_get_env` method of `CargoExecutor` in `test.py`, pointing to `test/tensor_shapes`. Additionally, the GitHub Actions workflow in `.github/workflows/pyrefly.yml` is updated to ensure this variable is consistently set during CI runs. This essential **maintenance fix** resolves ongoing **CI failures** on the main branch, ensuring the stability and correctness of the `scrut` test suite.
This commit **updates the documentation** for **agents** by adding a critical note to `AGENTS.md`. It advises users to explicitly run `python3 test.py` when executing tests in **external build environments**, as these setups typically lack the `fbpython` interpreter specified in the `test.py` shebang. This **documentation update** serves as a **maintenance improvement**, clarifying the correct procedure for running **tests** and preventing potential execution failures for external contributors. The change specifically impacts how **tests** are initiated outside of the standard internal build system, ensuring smoother operation.
This commit introduces a **conformance improvement** to the **`pyrefly` type checker's call resolution logic**, specifically addressing how `type[T]` calls are inferred. Previously, such calls inferred a generic callable `() -> T`; now, when `T` is bounded by a class, the system correctly uses the bound class's signature for inference while retaining `T` as the return type. This **enhances the accuracy of type inference for generic constructors**, particularly within the `pyrefly/lib/alt/call.rs` module, by extending `CallTarget::Class` and modifying `resolve_call_target`. While improving type soundness, this change may introduce new type errors in existing codebases due to more precise inference, as reflected by updates to the conformance test suite.
This commit **fixes a bug** in `pyrefly`'s **type annotation parsing** by preventing the construction of **invalid union types** that combine string literals (as forward references) with actual types (e.g., `"str" | int`). It introduces new logic in the `pyrefly/lib/alt/solve.rs` and `pyrefly/lib/binding/expr.rs` modules to detect and report these errors, which previously went unnoticed and would lead to runtime failures. This **improves the accuracy of type checking** by ensuring `pyrefly` correctly identifies annotations that would cause runtime failures, leading to a more robust static analysis and passing two additional conformance tests.
This commit introduces a **new validation rule** within the `pyrefly` compiler's **binding phase** to **disallow repeated type alias declarations**. Specifically, the logic in `pyrefly/lib/binding/stmt.rs` now detects and reports an error when an attempt is made to redefine an existing type alias, ensuring **type system consistency**. This **conformance improvement** aligns the compiler with language specifications, preventing silent redefinitions, and is verified by new test cases in `pyrefly/lib/test/type_alias.rs`.