Developer
Sam Goldman
samgoldman@meta.com
Performance
YoY:+2131%Key patterns and highlights from this developer's activity.
Breakdown of growth, maintenance, and fixes effort over time.
Bugs introduced vs. fixed over time.
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 | Effort |
|---|---|---|---|---|
| 30ccc279 | This commit introduces a **feature enhancement** to **LSP telemetry** by adding a `request_id` field to the `TelemetryEvent` struct in `crates/pyrefly_util/src/telemetry.rs`. This new identifier enables the **correlation of related LSP events**, such as `CancelRequest`, `LspRequest`, and `LspResponse`, for more comprehensive analysis. Concurrently, it **refactors the LSP server's request handling** in `pyrefly/lib/lsp/non_wasm/server.rs` to centralize the extraction of file statistics, specifically `textDocument.uri`, at the beginning of the request lifecycle. This ensures that all LSP requests, including those that are canceled, consistently carry relevant file metadata, significantly improving the ability to debug and monitor LSP interactions. | Mar 27 | 2 | grow |
| d8c5cf13 | This commit introduces new **telemetry enums**, `EmptyResponseReason` and `DefinitionContext`, within the **`pyrefly_util/telemetry` crate** to enhance diagnostics for empty Language Server Protocol (LSP) navigation results. These enums, equipped with `as_str()` and `detail()` methods, capture the specific reasons an LSP handler might return an empty response. The change also integrates an `empty_response_reason` field into `TelemetryEvent` and wires up the corresponding telemetry logging. This **new capability** significantly **improves observability** by allowing the system to distinguish between expected and unexpected empty responses, thereby aiding in the identification and resolution of underlying issues in failed navigations within internal builds. | Mar 26 | 1 | grow |
| d20b905b | This commit **refactors** the **LSP server** in `pyrefly/lib/lsp/non_wasm/server.rs` to return `null` for various requests when no result is found, instead of constructing empty default responses. This change affects **LSP navigation and information requests** such as `goto_definition`, `hover`, `code_action`, `inlay_hints`, and `semantic_tokens`. By sending `null`, the server more accurately signals "no result" as per the LSP specification, simplifying client-side dispatch and enabling improved downstream diagnostics for failed navigations. Corresponding **LSP interaction tests** were updated to expect these `null` responses, ensuring correct behavior. | Mar 26 | 2 | maint |
| 9291179f | This commit **enhances the LSP server's diagnostic capabilities** by introducing structured telemetry for empty responses from navigation-related handlers. It **refactors numerous LSP handler methods** in `pyrefly/lib/lsp/non_wasm/server.rs`, changing their return types to `Result<Option<T>, EmptyResponseReason>` or `Result<(), EmptyResponseReason>` and adding a new `HandleError` enum. This allows the **telemetry infrastructure** to record specific reasons like `NoFilePath` or `MethodDisabled` when an LSP request yields no results, significantly improving **diagnostics for failed LSP navigations** in internal builds. | Mar 26 | 1 | grow |
| b1773804 | This commit performs a **refactoring** within the **LSP navigation** subsystem by extracting the operator-to-dunder matching logic into a new helper function, `find_operator_dunder`, located in `pyrefly/lib/state/lsp.rs`. The `find_definition_for_operator` function is updated to utilize this new helper, **improving code reusability** and reducing duplication. This change prepares the codebase for a subsequent commit that will introduce a `Result`-returning variant for operator definition lookups, ultimately enhancing the robustness and diagnostic capabilities of **LSP features** like go-to-definition and hover. | Mar 26 | 1 | maint |
| be0c0620 | This commit **adds new `lsp_interaction` tests** to verify that the correct `EmptyResponseReason` is set on telemetry events for various LSP scenarios. These **tests** cover cases such as successful definitions, `LanguageServicesDisabled`, `MethodDisabled`, `NotAnIdentifier` (clicking on comments), and `DefinitionNotFound` (for undefined names and nonexistent attributes). This **enhances the testing infrastructure** for the **PyreFly LSP client**, ensuring the telemetry system accurately reports why navigation results might be empty, which is crucial for diagnosing and fixing root causes of failed navigations. The new tests validate these telemetry code paths within `pyrefly/lib/test/lsp/lsp_interaction/empty_response_reason.rs`, regardless of whether telemetry collection is enabled in open-source builds. | Mar 26 | 3 | maint |
| a826045c | This commit **refactors** the core **LSP definition-finding logic** by changing `find_definition` and related helper methods to return `Result<Vec1<...>, EmptyResponseReason>`. This **enhances diagnostics and telemetry** by providing specific `EmptyResponseReason` variants (e.g., `AstNotFound`, `DefinitionNotFound`) when no results are found, instead of just an empty vector. This change impacts a wide range of **LSP features** including `goto_definition`, `hover`, `call_hierarchy`, and various **quick fixes**, ensuring all callers now explicitly handle or map these structured error responses. The primary goal is to enable better identification and resolution of root causes for failed LSP navigations by distinguishing expected empty results from unexpected failures. | Mar 26 | 25 | maint |
| 37350b5b | This commit **refactors** the **PyreFly state management system** to enhance the explicitness and robustness of transaction finalization. It modifies `ModuleDataMut::take_and_freeze` to consume `self`, leveraging a new `ArcId::into_inner` method to directly unwrap and move module data during transaction teardown, thereby clarifying ownership and preventing accidental cloning or swapping. To bolster transaction integrity, **assertions** are added within `State::commit` to verify that temporary transaction queues (`todo`, `changed`, `dirty`) are empty before finalizing updates, ensuring `updated_modules` holds the sole reference to the module data. This **refactoring** is supported by the introduction of `ArcId::into_inner` in `crates/pyrefly_util/src/arc_id.rs` and `TaskHeap::is_empty` in `crates/pyrefly_util/src/task_heap.rs`. | Mar 25 | 3 | maint |
| 26c073bc | This commit **refactors** the **`pyrefly` state management library** to improve the clarity and correctness of transaction teardown. It modifies the `take_and_freeze` methods within both `ModuleStateMut` and `StepsMut` to **consume `self`**, explicitly signaling that these state objects are consumed during the commit process and cannot be reused. This change enhances ownership semantics and allows for the removal of the now-unused `clear_old_data` method, as old data is implicitly dropped when `take_and_freeze` consumes the object. The overall impact is a **cleaner and more explicit transaction finalization mechanism** within the `pyrefly` system. | Mar 25 | 2 | maint |
| 256e527d | This commit **enhances the `LockedMap` utility** by implementing the `IntoIterator` trait, providing a consuming iterator for its contents. This new capability is then leveraged in the **`pyrefly/lib/state/state.rs` module**, specifically within the `commit_transaction` logic. The change **refactors** the transaction commit process to directly consume updated modules and loaders, **improving efficiency** by eliminating redundant cloning. This also clarifies ownership semantics during transaction teardown, making the transaction's state consumption explicit. | Mar 24 | 2 | grow |
| c9f086f0 | Import lock_free_hashtable 0.1.2 | Mar 24 | 1 | – |
| 5285af59 | This commit performs a **maintenance update** by upgrading the **OSS build's dependency** on the `lock_free_hashtable` library to version `0.1.2`. The primary semantic change introduced by this update is the inclusion of **`IntoIterator` support** within the underlying hashtable implementation. This enhancement allows any modules or features within the project that rely on `lock_free_hashtable` to now leverage the new iteration capabilities provided by the `IntoIterator` trait. | Mar 24 | 3 | – |
| 5f57df05 | This commit introduces **owned iteration capabilities** to the **`lock_free_hashtable`** module by implementing the `IntoIterator` trait for `LockFreeRawTable`, `ShardedLockFreeRawTable`, and `FixedCapTable`. This **new feature** allows consumers to iterate over table entries, efficiently **reclaiming memory** without incurring cloning overhead. The implementation carefully ensures that only the current table owns entries, preventing double-frees from previous table versions. This enhances the utility of the lock-free hash tables by providing a more efficient way to extract and consume their contents. | Mar 23 | 3 | grow |
| 4c0ac6dc | This commit **fixes a regression** in **call-graph queries** that was introduced by a recent change to `find_definition` for LSP go-to-definition. The previous change caused `find_definition` to incorrectly resolve `__call__` dunders for `lru_cache` wrappers and callable targets during call-graph analysis, leading to an `AssertionError` in **py2hack**. To resolve this, a `resolve_call_dunders` flag was added to `FindPreference` and set to `false` in the relevant `find_definition` calls within `pyrefly/lib/query.rs`. This **bug fix** ensures that call-graph queries now correctly retrieve the underlying decorated functions, **restoring proper functionality** for tools like **py2hack**. | Mar 20 | 2 | waste |
| 4eefeb69 | This commit delivers a crucial **bug fix** addressing an **infinite loop** within the **variance inference** system, particularly impacting **self-referential generic classes**. The problem arose from `InferenceStatus::reset()` violating monotonicity by resetting inferred variances to `Bivariant`, and base classes being incorrectly processed at a `Covariant` position, introducing spurious constraints. The solution involves using `params.clone()` to guarantee monotonic variance progression and walking base classes at `Bivariant` to accurately propagate dependencies. This prevents infinite oscillations in the `fixpoint` calculation within `pyrefly/lib/alt/class/variance_inference.rs`, ensuring correct and robust type checking for complex generic type definitions. | Mar 18 | 2 | maint |
| 12e59d0b | This commit **updates the project's version string** within the `version.bzl` file, incrementing it from `0.56.0` to `0.57.0`. This is a **maintenance chore** that reflects a minor version increment, typically signifying the integration of new features or significant bug fixes since the previous release. It directly impacts the **project's versioning metadata**, which is crucial for release management, build systems, and any downstream consumers relying on the declared version. | Mar 17 | 12 | maint |
| 13b82f76 | This commit performs an **internal architectural refactoring** within the `pyrefly` alternative class implementation. It **migrates class field access** in the **`dataclass`, `enum`, `named_tuple`, and `total_ordering` modules** to consistently use the new `get_class_fields()` helper for `BindingsMetadata` lookup, rather than directly accessing `ClassInner`-embedded fields. This **refactoring** standardizes how class field information is retrieved across these core class-related utilities, improving code consistency and maintainability. Functions like `all_fields`, `get_enum_members`, `get_named_tuple_elements`, and `get_synthesized_rich_cmp_method` are updated to reflect this new approach, with negligible performance impact. | Mar 16 | 4 | maint |
| e8fdb7a5 | This commit performs a significant **refactoring** of the **class field access mechanism** within the `pyrefly` project. It **removes the direct `fields` storage** from `ClassInner` and all associated accessor methods from the `Class` struct, such as `contains` and `field_decl_range`. All callers, including **solver code paths** via `AnswersSolver` and **external consumers** like LSP, Pysa, and Query, are now updated to retrieve class fields consistently through `get_class_fields()` via `Bindings` or `Transaction`. This change centralizes the management of class fields, simplifying the `Class` definition and improving architectural clarity, with a neutral to slightly positive impact on performance metrics. | Mar 16 | 6 | maint |
| 96b982e3 | This commit **refactors the attribute lookup mechanism** within the **`pyrefly` static analysis engine**, specifically in the `alt/attr.rs` module. It migrates several functions, including `add_class_fields`, `has_custom_setattr`, and `completions_mro`, to retrieve class field information using the new `get_class_fields()` function, which leverages `BindingsMetadata` instead of direct `ClassInner` access. This **refactoring** centralizes how class field metadata is accessed, improving consistency and ensuring robust handling of stale cross-module classes. The change introduces a minor CPU regression in PyTorch benchmarks but has no significant impact on wall time or memory. | Mar 16 | 1 | maint |
| 8632b83a | This commit **refactors** the internal representation of class fields within the **`pyrefly_types` crate** by **extracting** the `SmallMap` of field properties from `ClassInner` into a new, dedicated **`ClassFields` newtype**. All existing field accessor methods on the `Class` struct now **delegate** their operations to this new `ClassFields` instance, centralizing field management logic. This change primarily affects the **`Class` and `ClassInner` data structures** and their associated field management, serving as a **preparation step** for future architectural improvements to decouple field storage. Minor updates were also made to `Class::new` calls in `pyrefly/lib/alt/class/classdef.rs` and test helpers to adapt to the new type. | Mar 16 | 4 | maint |
This commit introduces a **feature enhancement** to **LSP telemetry** by adding a `request_id` field to the `TelemetryEvent` struct in `crates/pyrefly_util/src/telemetry.rs`. This new identifier enables the **correlation of related LSP events**, such as `CancelRequest`, `LspRequest`, and `LspResponse`, for more comprehensive analysis. Concurrently, it **refactors the LSP server's request handling** in `pyrefly/lib/lsp/non_wasm/server.rs` to centralize the extraction of file statistics, specifically `textDocument.uri`, at the beginning of the request lifecycle. This ensures that all LSP requests, including those that are canceled, consistently carry relevant file metadata, significantly improving the ability to debug and monitor LSP interactions.
This commit introduces new **telemetry enums**, `EmptyResponseReason` and `DefinitionContext`, within the **`pyrefly_util/telemetry` crate** to enhance diagnostics for empty Language Server Protocol (LSP) navigation results. These enums, equipped with `as_str()` and `detail()` methods, capture the specific reasons an LSP handler might return an empty response. The change also integrates an `empty_response_reason` field into `TelemetryEvent` and wires up the corresponding telemetry logging. This **new capability** significantly **improves observability** by allowing the system to distinguish between expected and unexpected empty responses, thereby aiding in the identification and resolution of underlying issues in failed navigations within internal builds.
This commit **refactors** the **LSP server** in `pyrefly/lib/lsp/non_wasm/server.rs` to return `null` for various requests when no result is found, instead of constructing empty default responses. This change affects **LSP navigation and information requests** such as `goto_definition`, `hover`, `code_action`, `inlay_hints`, and `semantic_tokens`. By sending `null`, the server more accurately signals "no result" as per the LSP specification, simplifying client-side dispatch and enabling improved downstream diagnostics for failed navigations. Corresponding **LSP interaction tests** were updated to expect these `null` responses, ensuring correct behavior.
This commit **enhances the LSP server's diagnostic capabilities** by introducing structured telemetry for empty responses from navigation-related handlers. It **refactors numerous LSP handler methods** in `pyrefly/lib/lsp/non_wasm/server.rs`, changing their return types to `Result<Option<T>, EmptyResponseReason>` or `Result<(), EmptyResponseReason>` and adding a new `HandleError` enum. This allows the **telemetry infrastructure** to record specific reasons like `NoFilePath` or `MethodDisabled` when an LSP request yields no results, significantly improving **diagnostics for failed LSP navigations** in internal builds.
This commit performs a **refactoring** within the **LSP navigation** subsystem by extracting the operator-to-dunder matching logic into a new helper function, `find_operator_dunder`, located in `pyrefly/lib/state/lsp.rs`. The `find_definition_for_operator` function is updated to utilize this new helper, **improving code reusability** and reducing duplication. This change prepares the codebase for a subsequent commit that will introduce a `Result`-returning variant for operator definition lookups, ultimately enhancing the robustness and diagnostic capabilities of **LSP features** like go-to-definition and hover.
This commit **adds new `lsp_interaction` tests** to verify that the correct `EmptyResponseReason` is set on telemetry events for various LSP scenarios. These **tests** cover cases such as successful definitions, `LanguageServicesDisabled`, `MethodDisabled`, `NotAnIdentifier` (clicking on comments), and `DefinitionNotFound` (for undefined names and nonexistent attributes). This **enhances the testing infrastructure** for the **PyreFly LSP client**, ensuring the telemetry system accurately reports why navigation results might be empty, which is crucial for diagnosing and fixing root causes of failed navigations. The new tests validate these telemetry code paths within `pyrefly/lib/test/lsp/lsp_interaction/empty_response_reason.rs`, regardless of whether telemetry collection is enabled in open-source builds.
This commit **refactors** the core **LSP definition-finding logic** by changing `find_definition` and related helper methods to return `Result<Vec1<...>, EmptyResponseReason>`. This **enhances diagnostics and telemetry** by providing specific `EmptyResponseReason` variants (e.g., `AstNotFound`, `DefinitionNotFound`) when no results are found, instead of just an empty vector. This change impacts a wide range of **LSP features** including `goto_definition`, `hover`, `call_hierarchy`, and various **quick fixes**, ensuring all callers now explicitly handle or map these structured error responses. The primary goal is to enable better identification and resolution of root causes for failed LSP navigations by distinguishing expected empty results from unexpected failures.
This commit **refactors** the **PyreFly state management system** to enhance the explicitness and robustness of transaction finalization. It modifies `ModuleDataMut::take_and_freeze` to consume `self`, leveraging a new `ArcId::into_inner` method to directly unwrap and move module data during transaction teardown, thereby clarifying ownership and preventing accidental cloning or swapping. To bolster transaction integrity, **assertions** are added within `State::commit` to verify that temporary transaction queues (`todo`, `changed`, `dirty`) are empty before finalizing updates, ensuring `updated_modules` holds the sole reference to the module data. This **refactoring** is supported by the introduction of `ArcId::into_inner` in `crates/pyrefly_util/src/arc_id.rs` and `TaskHeap::is_empty` in `crates/pyrefly_util/src/task_heap.rs`.
This commit **refactors** the **`pyrefly` state management library** to improve the clarity and correctness of transaction teardown. It modifies the `take_and_freeze` methods within both `ModuleStateMut` and `StepsMut` to **consume `self`**, explicitly signaling that these state objects are consumed during the commit process and cannot be reused. This change enhances ownership semantics and allows for the removal of the now-unused `clear_old_data` method, as old data is implicitly dropped when `take_and_freeze` consumes the object. The overall impact is a **cleaner and more explicit transaction finalization mechanism** within the `pyrefly` system.
This commit **enhances the `LockedMap` utility** by implementing the `IntoIterator` trait, providing a consuming iterator for its contents. This new capability is then leveraged in the **`pyrefly/lib/state/state.rs` module**, specifically within the `commit_transaction` logic. The change **refactors** the transaction commit process to directly consume updated modules and loaders, **improving efficiency** by eliminating redundant cloning. This also clarifies ownership semantics during transaction teardown, making the transaction's state consumption explicit.
Import lock_free_hashtable 0.1.2
This commit performs a **maintenance update** by upgrading the **OSS build's dependency** on the `lock_free_hashtable` library to version `0.1.2`. The primary semantic change introduced by this update is the inclusion of **`IntoIterator` support** within the underlying hashtable implementation. This enhancement allows any modules or features within the project that rely on `lock_free_hashtable` to now leverage the new iteration capabilities provided by the `IntoIterator` trait.
This commit introduces **owned iteration capabilities** to the **`lock_free_hashtable`** module by implementing the `IntoIterator` trait for `LockFreeRawTable`, `ShardedLockFreeRawTable`, and `FixedCapTable`. This **new feature** allows consumers to iterate over table entries, efficiently **reclaiming memory** without incurring cloning overhead. The implementation carefully ensures that only the current table owns entries, preventing double-frees from previous table versions. This enhances the utility of the lock-free hash tables by providing a more efficient way to extract and consume their contents.
This commit **fixes a regression** in **call-graph queries** that was introduced by a recent change to `find_definition` for LSP go-to-definition. The previous change caused `find_definition` to incorrectly resolve `__call__` dunders for `lru_cache` wrappers and callable targets during call-graph analysis, leading to an `AssertionError` in **py2hack**. To resolve this, a `resolve_call_dunders` flag was added to `FindPreference` and set to `false` in the relevant `find_definition` calls within `pyrefly/lib/query.rs`. This **bug fix** ensures that call-graph queries now correctly retrieve the underlying decorated functions, **restoring proper functionality** for tools like **py2hack**.
This commit delivers a crucial **bug fix** addressing an **infinite loop** within the **variance inference** system, particularly impacting **self-referential generic classes**. The problem arose from `InferenceStatus::reset()` violating monotonicity by resetting inferred variances to `Bivariant`, and base classes being incorrectly processed at a `Covariant` position, introducing spurious constraints. The solution involves using `params.clone()` to guarantee monotonic variance progression and walking base classes at `Bivariant` to accurately propagate dependencies. This prevents infinite oscillations in the `fixpoint` calculation within `pyrefly/lib/alt/class/variance_inference.rs`, ensuring correct and robust type checking for complex generic type definitions.
This commit **updates the project's version string** within the `version.bzl` file, incrementing it from `0.56.0` to `0.57.0`. This is a **maintenance chore** that reflects a minor version increment, typically signifying the integration of new features or significant bug fixes since the previous release. It directly impacts the **project's versioning metadata**, which is crucial for release management, build systems, and any downstream consumers relying on the declared version.
This commit performs an **internal architectural refactoring** within the `pyrefly` alternative class implementation. It **migrates class field access** in the **`dataclass`, `enum`, `named_tuple`, and `total_ordering` modules** to consistently use the new `get_class_fields()` helper for `BindingsMetadata` lookup, rather than directly accessing `ClassInner`-embedded fields. This **refactoring** standardizes how class field information is retrieved across these core class-related utilities, improving code consistency and maintainability. Functions like `all_fields`, `get_enum_members`, `get_named_tuple_elements`, and `get_synthesized_rich_cmp_method` are updated to reflect this new approach, with negligible performance impact.
This commit performs a significant **refactoring** of the **class field access mechanism** within the `pyrefly` project. It **removes the direct `fields` storage** from `ClassInner` and all associated accessor methods from the `Class` struct, such as `contains` and `field_decl_range`. All callers, including **solver code paths** via `AnswersSolver` and **external consumers** like LSP, Pysa, and Query, are now updated to retrieve class fields consistently through `get_class_fields()` via `Bindings` or `Transaction`. This change centralizes the management of class fields, simplifying the `Class` definition and improving architectural clarity, with a neutral to slightly positive impact on performance metrics.
This commit **refactors the attribute lookup mechanism** within the **`pyrefly` static analysis engine**, specifically in the `alt/attr.rs` module. It migrates several functions, including `add_class_fields`, `has_custom_setattr`, and `completions_mro`, to retrieve class field information using the new `get_class_fields()` function, which leverages `BindingsMetadata` instead of direct `ClassInner` access. This **refactoring** centralizes how class field metadata is accessed, improving consistency and ensuring robust handling of stale cross-module classes. The change introduces a minor CPU regression in PyTorch benchmarks but has no significant impact on wall time or memory.
This commit **refactors** the internal representation of class fields within the **`pyrefly_types` crate** by **extracting** the `SmallMap` of field properties from `ClassInner` into a new, dedicated **`ClassFields` newtype**. All existing field accessor methods on the `Class` struct now **delegate** their operations to this new `ClassFields` instance, centralizing field management logic. This change primarily affects the **`Class` and `ClassInner` data structures** and their associated field management, serving as a **preparation step** for future architectural improvements to decouple field storage. Minor updates were also made to `Class::new` calls in `pyrefly/lib/alt/class/classdef.rs` and test helpers to adapt to the new type.
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.