Skip to content

docs: formalize locator refresh state contract#415

Merged
karthiknadig merged 2 commits intomainfrom
bug/issue-387
Apr 11, 2026
Merged

docs: formalize locator refresh state contract#415
karthiknadig merged 2 commits intomainfrom
bug/issue-387

Conversation

@karthiknadig
Copy link
Copy Markdown
Member

Summary:

  • Document the refresh-state contract for transient locator refreshes.
  • Add an inventory of current locator mutable state and classifications.
  • Add a regression test that pins create_locators() refresh-state classifications by platform.

Validation:

  • cargo test -p pet test_locator_graph_refresh_state_contracts_are_explicit
  • cargo fmt --all
  • cargo clippy --all -- -D warnings

Fixes #387

@karthiknadig karthiknadig requested a review from Copilot April 10, 2026 18:49
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 10, 2026

Performance Report (Linux) ➖

Metric PR (P50) PR (P95) Baseline (P50) Delta Change
Server Startup 1ms 1ms 1ms 0ms 0%
Full Refresh 79ms 293ms 78ms 1ms 0%

Results based on 10 iterations. P50 = median, P95 = 95th percentile.


Legend
  • 🚀 Significant speedup (>100ms faster)
  • ✅ Faster than baseline
  • ➖ No significant change
  • 🔺 Slower than baseline (>100ms)
  • ⚠️ Significant slowdown (>500ms)

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 10, 2026

Test Coverage Report (Linux)

Metric Value
Current Coverage 73.6%
Base Branch Coverage 73.4%
Delta .2% ✅

Coverage increased! Great work!

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 10, 2026

Performance Report (macOS)

Metric PR (P50) PR (P95) Baseline (P50) Delta
Server Startup 85ms 1078ms 101ms -16ms
Full Refresh 151ms 38247ms 184ms -33ms

Results based on 10 iterations. P50 = median, P95 = 95th percentile.


Legend
  • 🚀 Significant speedup (>100ms faster)
  • ✅ Faster than baseline
  • ➖ No significant change
  • 🔺 Slower than baseline (>100ms)
  • ⚠️ Significant slowdown (>500ms)

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 10, 2026

Performance Report (Windows) ➖

Metric PR (P50) PR (P95) Baseline (P50) Delta Change
Server Startup 9ms 12ms 9ms 0ms 0%
Full Refresh 164ms 2378ms 155ms 9ms 5.8%

Results based on 10 iterations. P50 = median, P95 = 95th percentile.


Legend
  • 🚀 Significant speedup (>100ms faster)
  • ✅ Faster than baseline
  • ➖ No significant change
  • 🔺 Slower than baseline (>100ms)
  • ⚠️ Significant slowdown (>500ms)

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 10, 2026

Test Coverage Report (Windows)

Metric Value
Current Coverage 69.86%
Base Branch Coverage 69.65%
Delta 0.21% ✅

Coverage increased! Great work!

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR formalizes and documents PET’s “refresh-state” contract for transient locator graphs, clarifying which locator state is expected to persist across refresh boundaries and adding a regression test to prevent accidental drift in those classifications.

Changes:

  • Add a dedicated document describing Locator::refresh_state() classifications and an inventory of current locator mutable state.
  • Link the new locator-state documentation from the project README.
  • Add a unit test that pins create_locators() locator ordering + RefreshStatePersistence classifications per platform.
Show a summary per file
File Description
README.md Adds a pointer to the new locator refresh-state contract documentation.
docs/LOCATOR_STATE.md Introduces the refresh-state contract and inventories locator state/classifications.
crates/pet/src/jsonrpc.rs Adds a regression test asserting each created locator’s refresh_state() classification (platform-aware).
crates/pet-core/src/lib.rs Expands inline documentation for RefreshStatePersistence and the Locator::refresh_state() contract.

Copilot's findings

  • Files reviewed: 4/4 changed files
  • Comments generated: 1

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR formalizes and documents the “refresh-state” contract for locators when refresh executes against a transient locator graph, ensuring it’s explicit which locator state is allowed/required to survive refresh boundaries.

Changes:

  • Add docs/LOCATOR_STATE.md documenting refresh-state classifications and an inventory of locator mutable state.
  • Link the new locator-state documentation from the root README.
  • Add a regression test that asserts create_locators() returns locators with explicit RefreshStatePersistence classifications per platform; clarify the contract in pet-core docs.
Show a summary per file
File Description
README.md Adds a pointer to the new locator refresh-state contract documentation; minor formatting cleanup.
docs/LOCATOR_STATE.md New doc describing refresh-state classifications and current locator state inventory.
crates/pet/src/jsonrpc.rs Adds a unit test pinning locator kinds to RefreshStatePersistence for the create_locators() graph.
crates/pet-core/src/lib.rs Expands rustdoc for RefreshStatePersistence and Locator::refresh_state() to codify the contract.

Copilot's findings

  • Files reviewed: 4/4 changed files
  • Comments generated: 0 new

@karthiknadig karthiknadig merged commit 172d4b1 into main Apr 11, 2026
34 checks passed
@karthiknadig karthiknadig deleted the bug/issue-387 branch April 11, 2026 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: formalize locator state that must survive refresh boundaries

3 participants