Repository navigation
feat(telemetry): schema 17 day-two activation instrumentation (Spec 126 PR-A) - #1940
Merged
Merged
Conversation
…ec 126 PR-A) Telemetry schema 17 separates dispatch from completion and adds install cohorts, with no onboarding, UI or API change. - Install anchor (FR-033): storage decides at open whether config.db held no record; EnsureInstallAnchor writes a UTC first-run time once, in its own bucket, at server startup, whatever the telemetry setting. - upstream_outcomes (FR-035, FR-036): one outcome per logical upstream call that dispatched, on the call_tool_* wrapper, direct routing and code_execution sub-calls, through a deferred recorder set up right after noteUpstreamDispatched. Part of the drained counter window, so a retry re-sends it byte-identical. coverage comes from a persisted undelivered-window marker; window_age is the install age when the window opened (fresh personal installs only). - StarterClassifier on Runtime (FR-037), default false. - day_two (FR-034, FR-038), personal edition only: install_origin, install_age (UTC calendar dates), success_scope_ever (forward-only, persisted). - ScanForPII closed-object checks for both objects (FR-029). - Schema pins moved to 17; telemetry docs and CLAUDE.md updated.
… anchor read once (Spec 126 PR-A) - FR-036: the undelivered-window marker is set by the first outcome after process start or each Drain and cleared on an accepted send only when nothing was recorded since the accepted snapshot's drain; a late hook for an accepted window writes nothing (drain epochs). An absent marker is partial once only when install_origin is existing; every start writes it as cleared when absent. - FR-035: window_age is the install age when the window opened (process start or the last Drain), stamped in CounterRegistry.Drain and frozen into the snapshot. - FR-034/FR-035: the install anchor is read once per process and shared by day_two and window_age, so they cannot disagree. - FR-037: direct routing reads the incarnation before dispatch. - FR-033: the empty-store fixture uses a real NewBoltDB open and close.
… (Spec 126 PR-A) - FR-036: one small mutex in the outcome window guards the increment, Drain's swap, the marker set (written before the first increment of a window) and the post-2xx clear (only when nothing was counted since the accepted snapshot's drain). deliveryMu is never taken on the tool-call path. Drain epochs and the late-hook path are gone. - FR-035: outcome counts take part in HasPendingCounters and Reset, so an outcome-only window is still flushed at shutdown. - FR-033: runtime.New records the install anchor after the Spec 080 shutdown marker and the Spec 123 OAuth boot sweep, before telemetry is wired; server.go no longer does it. - Runtime caches the reached success scope to skip the store read. - Docs and CLAUDE.md follow.
Deploying mcpproxy-docs with
|
| Latest commit: |
5a3878d
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://403bc932.mcpproxy-docs.pages.dev |
| Branch Preview URL: | https://claude-v0-75-activation-base.mcpproxy-docs.pages.dev |
…pre-lock stat (Spec 126 PR-A) Review (gpt-6.1-sol): NewBoltDB took os.Stat before bbolt.Open and let an absent or empty file override the record walk. Another process could populate config.db while this one waited up to 10 s for the lock, and the store would then read as empty and get an install anchor. Emptiness now comes only from storeHasRecords on the opened, locked database; a file bbolt.Open just created holds no records, so it still reads as empty. TestNewBoltDB_StorePopulatedBeforeLockIsNotEmpty writes a record in that window through a test-only hook; it fails with the old stat.
Dumbris
marked this pull request as ready for review
November 19, 2026 12:33
Contributor
📦 Build ArtifactsWorkflow Run: View Run Available Artifacts
How to DownloadOption 1: GitHub Web UI (easiest)
Option 2: GitHub CLI gh run download 44559549428 --repo smart-mcp-proxy/mcpproxy-go
|
|
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
TestE2E_TrayToCore_UnixSocket, TestE2E_DualListener_Concurrent and TestE2E_SocketPermissions started a Server and deliberately never shut it down. Each one left its runtime, upstream manager and network-recovery watcher running, so the TestMain guard from #1936 failed the E2E job (`-run TestE2E`) with "3 upstream.Manager network-recovery watcher(s) still running". #1936's sweep ran with `-skip E2E` and never saw them. stopSocketE2EServer shuts the server down, cancels its context and waits for Start to return. It is deferred after the socketE2EMutex unlock, so it runs while the mutex is held, before the next socket test starts. Verified: the guard fails with the three tests on the old file and passes with this change; the CI E2E command passes.
… merge cleanly #1941 makes the same shutdown fix in socket_e2e_test.go. Taking its file byte-for-byte means whichever PR lands second merges without a conflict. The CI E2E command still passes with the leak guard.
Dumbris
added a commit
that referenced
this pull request
Nov 20, 2026
`roadmap.yaml` had no epics after Spec 117. This PR adds them and regenerates `ROADMAP.md`. - **Shipped:** 118 auto-rescan (#1689), 118 pin visibility boundary (#1684, #1688, #1821), 119 (#1740), 120 (#1781), 122 (#1818) and 123 (#1886, #1887, #1888, #1891). - **In review:** 121 install surfaces (#1711). There is no `spec:` link yet because its folder exists only on the PR branch. - **In progress:** 124 (PR-1 #1918 done; PR-2 CLI and PR-3 Web UI to do) and 125 (spec plus PR-1..3 done; PR-4 Web UI to do). Merged PRs are listed as done child tasks, so `--check-github` doesn't flag a merged PR under an in-progress epic. - **Spec-only PRs:** 127 (#1943), 128 (#1944) and 129 (#1945). Merge this after #1943, #1944 and #1945. Until then, `--check-github` reports their `spec:` links as unresolved; `--check`, the pre-commit hook, passes. Not covered: Spec 126 (#1940, open) and the unsynced tasks.md checkboxes for 123 and 124.
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
This is Spec 126 PR-A, instrumentation only: telemetry schema 17, which lets day-two activation be measured per install with anonymous, closed-enum fields. It is the Go side of the measurement. The receiver is in mcpproxy-telemetry#13, and the cohort report is in mcpproxy-dash#15. The spec is #1712.
config.dbwas empty at open (internal/storage/install_anchor.go). An existing store never gets one.day_two(FR-034, FR-038), personal edition only:install_origin:freshorexisting;install_age:d0_6,d7_13ord14_plus(UTC calendar dates from the anchor);success_scope_ever:none,starter_onlyornon_starter. It is persisted and moves forward only.upstream_outcomes(FR-035, FR-036), both editions, reset on accept:succeeded,unusableandsucceeded_non_starter.window_ageis frozen when the window opens at drain, so a window that opened in days 7–13 cannot hold week-one calls.coverageispartialwhen a persisted undelivered-window marker shows that counts were lost (a kill before delivery). A retry of a pending snapshot is byte-identical.StarterClassifieris keyed by server name and incarnation. PR-A installs no starter, so the default answersfalse, andstarter_onlycannot occur until PR-B installs one.activation.first_real_tool_call_ever, on every dispatch path:call_tool_*, direct routing andcode_executionsub-calls. A refused call changes nothing.isError:trueand that no output policy withheld.isErroror a withheld result counts asunusable.anonymity.go) rejects unknown keys and values in both new objects. There are no names and no ids; the new fields are booleans and closed enums only.What it measures (v0.75.0 activation baseline): first success in days 0–6 and same-install repeat in days 7–13 become measured figures, not the receipt-dated bounds that schema ≤ 16 allows. Starter-only use is reported apart from both.
Test evidence
These ran at the PR head, rebased on
origin/main58a824e (head 39aaf66).go build ./...andgo build -tags server ./...both succeed.go test -race ./internal/telemetry/... ./internal/storage/...passes.go test -race ./internal/runtime/...passes (internal/runtime420 s, plusconfigsvc,stateview,supervisorandsupervisor/actor).go test -race -tags server -timeout 40m -skip "E2E|Binary|MCPProtocol|TestInfoEndpoint|TestGracefulShutdownNoPanic|TestSocketInfoEndpoint" ./internal/server/...passes (internal/server1,588 s,internal/server/tokens)../scripts/test-api-e2e.shpasses: 77 passed, 0 failed.TestNewBoltDB_StorePopulatedBeforeLockIsNotEmptyis new with the review fix below. It fails on the old pre-lock stat and passes now.golangci-lintv2, both bare and--build-tags server, reports 0 new issues againstorigin/main.isError, transport error, refused before dispatch, withheld by sanitisation or validation, starter);install_age;window_agefrozen at drain;window_age.cmd/mcpfixtureover stdio, in a scratch data dir, with telemetry pointed at a local sink, so nothing was sent to production. It made one successfulfixture:echocall, one call refused before dispatch (an unknown tool), and one call dispatched to a stalled upstream and cancelled.GET /api/v1/telemetry/payloadthen showed:Review
opencode
github-copilot/gpt-6.1-sol(high) reviewed the change in three file chunks. Telemetry window and registry: CLEAN. Dispatch paths,day_two, scope and anonymity: CLEAN.The storage and runtime chunk found one P2.
NewBoltDBlet anos.Stattaken beforebbolt.Openoverride the record walk, so a store populated by another process during the 10 s lock wait could get an install anchor. It is fixed in 39aaf66, which decides only from the locked database, with a regression test. Round 2: CLEAN.Merge order
mcpproxy-telemetry#13 must be merged, which deploys the worker, before any build that contains this PR sends telemetry. That includes release candidates. Until then the receiver does not copy
upstream_outcomesintoheartbeat_events, so those windows would be lost to the cohort report.Not in this PR