feat: report refresh phase progress telemetry (Fixes #479) - #494
Merged
Conversation
Expose a refresh operation ID in results and emit privacy-safe phase and per-locator timing notifications for timeout diagnosis. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Performance Report (Linux) ➖
Legend
|
Performance Report (macOS)
Legend
|
Performance Report (Windows) ➖
Legend
|
Test Coverage Report (Linux)
Coverage increased! Great work! |
Test Coverage Report (Windows)
Coverage increased! Great work! |
Copilot started reviewing on behalf of
Karthik Nadig (karthiknadig)
July 29, 2026 15:42
View session
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds privacy-safe refresh progress telemetry to PET’s JSON-RPC refresh flow so timeouts can be diagnosed by identifying which major phase (and which locator within the locator phase) was running when a refresh was interrupted. It introduces a refreshId for correlating refresh results and progress events, and updates documentation and tests to validate payload shape and privacy constraints.
Changes:
- Add
refreshIdto therefreshresult for correlation across refresh responses and progress telemetry. - Emit
RefreshProgresstelemetry (started/completed) for the major refresh phases and per-locator timing within the locators phase. - Document and test the JSON-RPC telemetry payload, including field casing and ensuring no path/environment data is included.
Show a summary per file
| File | Description |
|---|---|
| docs/JSONRPC.md | Documents refreshId in refresh results and the RefreshProgress telemetry payload shape and privacy guarantees. |
| crates/pet/src/jsonrpc.rs | Generates refreshId, includes it in refresh results, and passes it into refresh discovery for progress reporting. |
| crates/pet/src/find.rs | Implements RefreshProgress emission for phase start/complete and per-locator start/complete with elapsed timings. |
| crates/pet-core/src/telemetry/mod.rs | Adds the RefreshProgress telemetry event variant and event name mapping. |
| crates/pet-core/src/telemetry/refresh_progress.rs | Defines the telemetry model (RefreshProgress, phase/status enums) with camelCase serialization. |
| crates/pet-reporter/src/jsonrpc.rs | Adds serialization test ensuring RefreshProgress payload is camelCase and privacy-safe. |
| crates/pet/tests/jsonrpc_client.rs | Extends test client to deserialize refreshId and to filter/wait for telemetry events by name. |
| crates/pet/tests/jsonrpc_server_test.rs | Updates JSON-RPC integration tests to validate RefreshPerformance and RefreshProgress counts and refreshId correlation + privacy checks. |
| crates/pet/src/lib.rs | Updates find_and_report_envs call sites for the new optional refresh_id parameter. |
| crates/pet/tests/ci_test.rs | Updates find_and_report_envs call sites for the new optional refresh_id parameter. |
| crates/pet/tests/ci_poetry.rs | Updates find_and_report_envs call sites for the new optional refresh_id parameter. |
| crates/pet/tests/ci_jupyter_container.rs | Updates find_and_report_envs call sites for the new optional refresh_id parameter. |
| crates/pet/tests/ci_homebrew_container.rs | Updates find_and_report_envs call sites for the new optional refresh_id parameter. |
Review details
- Files reviewed: 13/13 changed files
- Comments generated: 0
- Review effort level: Low
Karthik Nadig (karthiknadig)
marked this pull request as ready for review
August 5, 2026 21:08
Aaron Munger (amunger)
approved these changes
Aug 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
refreshIdin refresh results for operation correlationValidation
cargo test -p pet-corecargo test -p pet-reporter refresh_progress_serializes_privacy_safe_fieldscargo test -p pet --test jsonrpc_server_testcargo test -p pet refresh_progress_reports_phases_and_locator_timing.\scripts\rust-precommit.ps1Fixes #479