← Back to Pull requests

Change '_handler' from public to package access #225

Merged
adityasingh2400 merged 3 files (240 lines) on May 29, 2026 12:41 UTC
View on GitHub
adityasingh2400 adityasingh2400 commented on May 29, 2026 07:50 UTC
Author

Lower the _handler properties from public to package access, matching _factory.

Motivation:

The _handler (and _factory) properties on Counter, FloatingPointCounter, Meter, Recorder, and Timer are not part of the public API. Their doc comments already state "Do not consider them part of the public API" and they are hidden from documentation via @_documentation(visibility: internal). They are only exposed so that MetricsTestKit can reach into them.

These properties were declared public because they predate the package access level. As requested in issue #173 (and the earlier review discussion on #172, where the maintainers asked for package to be used), _factory was already migrated to package. This change finishes the job for the matching _handler properties so the testing-only surface is no longer part of the public API.

Modifications:

  • Changed _handler on Counter, FloatingPointCounter, Meter, Recorder, and Timer from public let to @usableFromInline package let.

  • Added @usableFromInline because _handler is referenced from existing @inlinable members (increment, reset, record, destroy, ...); this mirrors the existing @usableFromInline package let _factory declaration.

  • Updated the accompanying doc comments to say the properties are only package (instead of "only public") to allow access from MetricsTestKit.
  • Result:

    The _handler and _factory testing-only properties are now package rather than public, consistent with their documented "not public API" intent and with the maintainers' request. MetricsTestKit continues to access them within the same package, and the full test suite passes (103 tests in 8 suites). Note this lowers the access level of underscore-prefixed, documentation-hidden symbols, so it is technically source-breaking for any code that reached into them directly.

    Fixes #173

    Diff: 240 lines (+180 / -60) across 3 files Reviewer: None requested Review duration: 290m
    All Vouch review confidence checks passed
    Residual risk 0.28 = Change Risk (0.51) × (1 − Review Confidence (0.44)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.51 · 240 lines diff across 3 files
    0.51
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 10%
    44%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.328
    No Reviewer Assigned no_reviewer_assigned
    0.120
    Real PR Conversation Timeline
    1 comments
    "Review active on #225"
    general weight: 0.35
    Reviewers
    None requested
    Assignees
    adityasingh2400 adityasingh2400
    Labels
    risk: low confidence: 44.2% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 50.7% (MEDIUM) · Higher = larger blast radius
    50.7%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 44.2% · Lower = rushed or shallow review
    44.2%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 28.3% · Safe to merge
    28.3%