Repository navigation
feat(046-us3): onboarding-funnel telemetry — payload fields + privacy guards - #434
Merged
Merged
Conversation
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Contributor
📦 Build ArtifactsWorkflow Run: View Run Available Artifacts
How to DownloadOption 1: GitHub Web UI (easiest)
Option 2: GitHub CLI gh run download 25069895619 --repo smart-mcp-proxy/mcpproxy-go
|
Dumbris
force-pushed
the
046-local-first-onboarding
branch
from
April 28, 2026 18:12
cd981ea to
4729cc1
Compare
Dumbris
force-pushed
the
046-us3-telemetry
branch
from
April 28, 2026 18:12
dba68cf to
867b4c1
Compare
… guards
Adds five anonymous, fixed-enum heartbeat fields per Spec 046 US3 so we can
measure whether the new onboarding wizard moves day-2 retention from the
current 11.8% baseline. Bumps the heartbeat schema_version to 4. Existing
v3 consumers ignore the new fields; v1/v2/v3 clients continue to send the
exact same payload they did before.
The provider closes over connect.Service (for connected-client count + fixed-
enum IDs) and the BBolt-backed OnboardingState (for wizard engagement +
per-step status). Wired in internal/server/server.go alongside the existing
connect-service wire-up so a single consultation returns fresh data each
heartbeat.
## Changes
- internal/telemetry/telemetry.go:
- SchemaVersion bumped 3 -> 4 with a doc comment summarising the v4 delta
- HeartbeatPayload gains connected_client_count, connected_client_ids,
wizard_engaged, wizard_connect_step, wizard_server_step (all omitempty)
- New OnboardingSnapshot struct + SetOnboardingProvider setter, populated
in buildHeartbeat with the standard nil-safe pattern
- internal/server/server.go: wires the onboarding provider on the telemetry
service inside the existing "if cfg := s.runtime.Config()" block so the
closure captures the just-built connect.Service
- internal/telemetry/payload_privacy_test.go: extends the canary test to
v4 (schema_version 4) and adds two new tests —
TestPayloadV4_OnboardingFieldsArePresent and
TestPayloadV4_OnboardingDoesNotLeakUserStrings — that assert the wire
shape carries no paths/URLs/free-text, only fixed-enum adapter IDs
- internal/telemetry/payload_v2_test.go + telemetry_test.go: tripwire
schema_version assertions updated 3 -> 4
## Privacy posture
Inherits Spec 042 / Spec 044: opt-out, anonymous, off-by-default in CI/test,
no transmission when telemetry is disabled. The new fields cannot carry
user-entered values:
- connected_client_count is a non-negative integer
- connected_client_ids comes strictly from connect.Service.GetConnectedIDs()
which iterates the fixed per-client adapter table — paths, names, and
arbitrary strings cannot reach this field
- wizard_engaged is a boolean
- wizard_connect_step and wizard_server_step are tri-state strings
(""/completed/skipped) sourced from the OnboardingState bucket
The Cloudflare Worker (companion change in mcpproxy-telemetry) re-validates
all five fields shape-side before INSERT, so a regression on either side
gets caught.
## Tests
- internal/telemetry: full suite passes (privacy, schema, payload v2, v4)
- internal/connect, internal/storage, internal/httpapi: unchanged + still pass
- Build: ok ./...
- Manual end-to-end against /api/v1/telemetry/payload — schema_version=4
with all five fields populated correctly from BBolt + connect.Service
Companion changes:
- mcpproxy-telemetry: D1 migration 0005_add_onboarding_funnel.sql,
validateV4Payload, INSERT/UPDATE bindings, 29 new validation tests
(74 -> 103 passing)
- mcpproxy.app-website: /telemetry page documents the five new fields
with the same level of detail as existing fields
Related #46
Dumbris
force-pushed
the
046-us3-telemetry
branch
from
April 30, 2026 15:15
867b4c1 to
6e97d6a
Compare
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
Adds five anonymous, fixed-enum heartbeat fields (Spec 046 US3) so we can measure whether the new onboarding wizard moves day-2 retention from the current 11.8% baseline. Bumps
schema_version3 → 4. v3 consumers ignore the new fields; v1/v2/v3 clients keep sending the same payload they did before.Stacked on top of #433 (the wizard PR). Merge that first; this PR rebases naturally.
Companion changes (separate repos / separate PRs):
mcpproxy-telemetry#spec-046-onboarding-funnel— D1 migration0005_add_onboarding_funnel.sql, worker validation, 29 new validation tests (74 → 103 passing).mcpproxy.app-website#spec-046-telemetry-fields—/telemetrypage documents the five new fields with the same level of detail as existing fields.Fields added to
HeartbeatPayloadconnected_client_countconnect.Service.GetConnectedCount()2connected_client_ids[]string(fixed-enum adapter IDs)connect.Service.GetConnectedIDs()["claude-code","cursor"]wizard_engagedOnboardingState.Engagedtruewizard_connect_stepOnboardingState.ConnectStepStatus"completed"wizard_server_stepOnboardingState.ServerStepStatus"skipped"The provider closes over
connect.Serviceand the BBolt-backedOnboardingState, wired ininternal/server/server.goalongside the existing connect-service wire-up so a single consultation returns fresh data each heartbeat.Privacy posture
Inherits Spec 042 / Spec 044: opt-out, anonymous, off-by-default in CI/test, no transmission when telemetry is disabled. The new fields cannot carry user-entered values:
connected_client_countis a non-negative integerconnected_client_idscomes strictly fromconnect.Service.GetConnectedIDs(), which iterates the fixed per-client adapter table — paths, names, and arbitrary strings cannot reach this fieldwizard_engagedis a booleanwizard_connect_stepandwizard_server_stepare tri-state strings sourced from BBoltTwo new privacy regression tests assert this in code:
TestPayloadV4_OnboardingFieldsArePresent— verifies the five fields reach the wire when the provider is wiredTestPayloadV4_OnboardingDoesNotLeakUserStrings— asserts/Users/,/home/,http://,localhost,Bearer,apikey=, etc. never appear in a v4 payloadThe companion worker validates the wire shape before INSERT — a regression on either side trips a test.
Test plan
internal/telemetry: full suite passes (privacy, schema, payload v2, v4)internal/connect,internal/storage,internal/httpapi: unchanged + still passgo build ./...: okGET /api/v1/telemetry/payload—schema_version=4with all five fields populated correctly:Out of scope
connected_client_idsonce it's added tointernal/connect/clients.go's adapter table — no further telemetry plumbing needed.Related #46