refactor(server): classify telemetry exports#10277
Telemetry, diagnostics, resource monitoring, and usage modules had 21 unclassified runtime exports. This marks eight canonical Effect service constructors as intentionally public and keeps 13 implementation helpers private without changing telemetry or usage contracts.
This is layer 4 of 9 in the server Knip cleanup stack.
Verification after rebasing onto current main: server typecheck and the server-only Knip export audit pass. Changed-file lint and formatting pass, with one existing lint warning. Focused auth, provider, source-control, preview toolkit, orchestration, and Knip preprocessor tests pass: 90 tests across 9 files. This changes server export visibility and static analysis; screenshots do not apply.
Model: gpt-6 astra. Harness: Codex in T3 Code.
Summary by CodeRabbit
Documentation
- Added public API documentation for several service constructors and diagnostic components.
Refactor
- Reduced the public API surface by making internal helpers, constants, platform utilities, usage formatters, and telemetry functions module-private.
- Existing behavior remains unchanged.
Approvability
A prior Macroscope approval was dismissed. Re-evaluating 40fea11โฆ
No code changes detected at 71d237b. Prior analysis still applies.
Thread transfer impact
โ Thread transfer remains within every enforced ceiling.
โน๏ธ No successful
mainbaseline artifact is available yet. This run establishes the initial measurement.
| Provider | Metric | Main baseline | This PR | Impact | PR ceiling | |
|---|---|---|---|---|---|---|
| Codex | Total thread wire | โ | 13.6 KiB | โ | 15.1 KiB | โ |
| Codex | Thread snapshot wire | โ | 7.0 KiB | โ | 7.3 KiB | โ |
| Codex | Live turn WebSocket wire | โ | 6.5 KiB | โ | 7.8 KiB | โ |
| Codex | Live turn WebSocket decoded | โ | 57.0 KiB | โ | 66.4 KiB | โ |
| Codex | Live turn messages | โ | 8 | โ | 21 | โ |
| Claude | Total thread wire | โ | 13.6 KiB | โ | 15.1 KiB | โ |
| Claude | Thread snapshot wire | โ | 7.0 KiB | โ | 7.3 KiB | โ |
| Claude | Live turn WebSocket wire | โ | 6.5 KiB | โ | 7.8 KiB | โ |
| Claude | Live turn WebSocket decoded | โ | 57.8 KiB | โ | 66.4 KiB | โ |
| Claude | Live turn messages | โ | 9 | โ | 21 | โ |
Baseline: unavailable ยท PR result: 71d237b ยท Source CI: success
Scenario and decoded snapshot size
10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
- Codex decoded thread snapshot: 113.9 KiB
- Claude decoded thread snapshot: 114.6 KiB
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.
Added 1 commit
- refactor(server): keep telemetry helpers private71d237b
Bugbot is paused โ on-demand spend limit reached
Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.
A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.
Review Change StackReview Change Stack
No actionable comments were generated in the recent review. ๐
โน๏ธ Recent review info
โ๏ธ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Advanced
Run ID: 70066dd7-f1be-4492-8b52-a21465f36956
๐ฅ Commits
Reviewing files that changed from the base of the PR and between 4f890a2689834d586693264eb984b6392359c77d and 71d237b15304d483225aa9c5136618396b38db12.
๐ Files selected for processing (16)
apps/server/integration/NetworkTransferMeasurement.integration.tsapps/server/integration/TransferBudgetReport.integration.tsapps/server/integration/TransferBudgetScenario.integration.tsapps/server/src/diagnostics/ProcessDiagnostics.tsapps/server/src/diagnostics/ProcessResourceMonitor.tsapps/server/src/diagnostics/TraceDiagnostics.tsapps/server/src/resourceTelemetry/DesktopTelemetryReceiver.tsapps/server/src/resourceTelemetry/Model.tsapps/server/src/resourceTelemetry/NativeTelemetryClient.tsapps/server/src/resourceTelemetry/ResourceMonitorBinary.tsapps/server/src/resourceTelemetry/ResourceTelemetry.tsapps/server/src/telemetry/AnalyticsService.tsapps/server/src/usage/UsageLimitSources.tsapps/server/src/usage/usageAggregation.tsapps/server/src/usage/usageScanCache.tsapps/server/src/usage/usageTranscripts.ts
Limit details: Youโve used all 10 included reviews currently available.
๐ Walkthrough
Walkthrough
The changes narrow module exports for internal helpers and constants. They also add public API documentation to canonical Effect service constructors.
Changes
API surface cleanup
| Layer / File(s) | Summary |
|---|---|
Integration helper visibility apps/server/integration/* | WebSocket measurement helpers and transfer budget constants are now module-private. |
Diagnostics and resource telemetry API apps/server/src/diagnostics/*, apps/server/src/resourceTelemetry/* | Resource telemetry helpers are narrowed to module scope, and service constructors receive public API documentation. |
Analytics and usage API apps/server/src/telemetry/AnalyticsService.ts, apps/server/src/usage/* | Analytics and usage helpers are narrowed to module scope, while service construction receives public API documentation. |
Estimated code review effort: 1 (Trivial) | ~5 minutes
Merge Risk: โช Minimal ยท up to 71d23
This refactor makes internal telemetry, diagnostics, resource-monitoring, and usage helpers private while documenting canonical service constructors. No current-head runtime or contract regression is identified, so the change is ready to merge.
Suggested reviewers: t3dotgg
๐ฅ Pre-merge checks | โ 4 | โ 1
โ Failed checks (1 warning)
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Docstring Coverage | โ ๏ธ Warning | Docstring coverage is 6.25% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 16 functions across 16 files. | Write docstrings for the functions missing them to satisfy the coverage threshold. |
โ Passed checks (4 passed)
| Check name | Status | Explanation |
|---|---|---|
| Linked Issues check | โ Passed | Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check | โ Passed | Check skipped because no linked issues were found for this pull request. |
| Title check | โ Passed | The title clearly and concisely describes the main change: classifying server telemetry-related exports. |
| Description check | โ Passed | The description explains the export classification, scope, rationale, verification, and UI applicability. It does not use the template headings or include the checklist, but the required information iโฆ |
- Fix all pre-merge checks with AI
โจ Finishing Touches ๐ก 1
๐ Generate docstrings ๐ก
- Create stacked PR
- Commit on current branch
๐งช Generate unit tests (beta)
- Create PR with unit tests
- Commit unit tests in branch
cleanup-server/telemetry-usage-internals
Comment @coderabbitai help to get the list of available commands.