Skip to content

feat(telemetry): TPA-scanner stats (schema v8) + tray menu alignment QA - #956

Merged
github-actions[bot] merged 4 commits into
mainfrom
feat/tpa-telemetry-tray-qa
Aug 5, 2026
Merged

feat(telemetry): TPA-scanner stats (schema v8) + tray menu alignment QA#956
github-actions[bot] merged 4 commits into
mainfrom
feat/tpa-telemetry-tray-qa

Conversation

@Dumbris

@Dumbris Dumbris commented Aug 5, 2026

Copy link
Copy Markdown
Member

What

Two changesets, disjoint areas:

1. Anonymous TPA-scanner telemetry (heartbeat schema v7 → v8)

  • New tpa_scanner payload block: scans completed / failed / with-findings + findings by severity (fixed 5-key enum), plus feature_flags.deep_scan_enabled.
  • Counting unit: one Pass-1, non-dry-run scan job. Deep-scan Pass-2 jobs and per-scanner failures are excluded — counting them would double-report exactly the deep-scan cohort the flag exists to compare. Recording is gated in the scanner package via a new EventEmitter.EmitSecurityScanTelemetry seam; UI-facing scan events no longer touch telemetry.
  • Privacy: counts and enum keys only. Server names, scanner ids, rule ids, finding titles and paths structurally cannot reach the payload; a new v8_field_invalid anonymity rule drops malformed payloads before send. Counters reset only after an accepted (2xx) heartbeat.
  • Ingest worker needs zero changes (stores unknown payload fields wholesale). Dashboard section lands separately in mcpproxy-dash.

2. macOS tray menu alignment + native Activity routing

  • Histogram spans the full menu width (flexible-width autoresizing + maxWidth: .infinity; 272pt floor; cache resets width so a once-wide menu can't ratchet).
  • "Recent"/"Clients" are real NSMenuItem.sectionHeaders on macOS 14+; successful rows carry an invisible 16×16 placeholder so all titles share one leading edge while failures stay the only visible marks (FR-010); glyphs normalized to 16pt.
  • Start/Stop/Disconnect Core items lose their oversized 18×18 icons — bottom command block sits on one leading edge.
  • "Open Activity…" + Recent rows open the native window at the Activity section (showMainWindow(tab:) honours its previously-dead parameter; .switchToSidebarTab notification for live windows, MainWindow(initialTab:) for fresh ones; miniaturized windows deminiaturize instead of duplicating). Web-UI deep-link path (GlanceLinks) deleted.

Verification

  • go test -race green: telemetry, scanner, runtime. golangci-lint v2 (CI config): 0 issues. ./scripts/test-api-e2e.sh PASS.
  • Swift: 788 tests pass (4 new pins: section headers, chart autoresizing, notification decode seam, routing destination). Verified live on the dev tray via mcpproxy-ui-test with seeded success/error/blocked activity — before/after screenshots reviewed.
  • 11-agent adversarial review over the full diff: 7 confirmed findings, all fixed (incl. Pass-2 double-count and per-scanner failure inflation in the first telemetry wiring).

Dumbris added 2 commits August 5, 2026 13:20
New tpa_scanner payload block: scans completed/failed/with-findings and
findings by severity (fixed 5-key enum), plus feature_flags.deep_scan_enabled.
Counting unit is one Pass-1, non-dry-run scan job — deep-scan Pass-2 jobs and
per-scanner failures are explicitly excluded so the deep-scan cohort
comparison is not skewed. Recording is gated in the scanner package via a new
EventEmitter.EmitSecurityScanTelemetry seam; the UI-facing scan events no
longer touch telemetry.

Privacy: counts and enum keys only — server names, scanner ids, rule ids,
finding titles and paths structurally cannot reach the payload; a new
v8_field_invalid anonymity rule drops any malformed payload before send.
Counters live in CounterRegistry under one lock (snapshot can never show
findings without scans) and reset only after an accepted heartbeat.
Four visual defects and one routing defect in the tray menu:

- Histogram now spans the full menu width: the NSHostingView gets a
  flexible-width autoresizing mask (SwiftUI maxWidth .infinity, 272pt floor)
  instead of a fixed frame that left a dead band whenever a text row was
  wider. The cached chart item resets its width when reused so a once-wide
  menu cannot ratchet permanently.
- 'Recent' and 'Clients' are real NSMenuItem.sectionHeaders on macOS 14+
  (disabled-row fallback below), not full-size disabled rows.
- Successful Recent rows carry an invisible 16x16 placeholder image so every
  title in the section shares one leading edge while failures stay the only
  visible marks (FR-010); all glance glyphs normalized to 16pt.
- Start/Stop/Disconnect Core items lose their oversized 18x18 icons — the
  bottom command block now sits on one leading edge like its neighbours.
- 'Open Activity…' and Recent rows open the native main window at the
  Activity section (showMainWindow(tab:) now honours its previously-dead
  parameter; fresh windows seed via MainWindow(initialTab:), live windows
  via a new .switchToSidebarTab notification; a miniaturized window is
  deminiaturized instead of duplicated). The Web-UI deep-link path
  (GlanceLinks) is deleted; Web UI stays reachable via 'Open Web UI'.

Verified live via mcpproxy-ui-test against an isolated core with seeded
success/error/blocked activity. 788 tests pass; new pins cover section
headers, chart autoresizing, the notification decode seam and the glance
routing destination.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 5, 2026

Copy link
Copy Markdown

Deploying mcpproxy-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 01a3ee5
Status: ✅  Deploy successful!
Preview URL: https://b1d499d3.mcpproxy-docs.pages.dev
Branch Preview URL: https://feat-tpa-telemetry-tray-qa.mcpproxy-docs.pages.dev

View logs

… reject null objects

The v8 anonymity rule copied an unknown tpa_scanner key into the violation
Pattern, which sendHeartbeat logs — echoing the key there is itself the leak
the rule exists to stop; the pattern is now constant. tpa_scanner:null and
findings:null unmarshal into nil maps and slipped past the object-shape
check; both are rejected explicitly. The Snapshot-to-Reset loss window is
documented as the deliberate registry-wide semantic (shared by every
counter; anonymous daily aggregates, seconds-long window).
@Dumbris
Dumbris force-pushed the feat/tpa-telemetry-tray-qa branch from 3354fba to 3a3aac5 Compare August 5, 2026 10:29
The payload-endpoint test asserted schema_version == 7 literally; v8 (the
tpa_scanner block) is additive and the v7 fields keep rendering, which is
what the test actually pins.
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 95.48872% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/telemetry/tpa_scanner.go 70.58% 3 Missing and 2 partials ⚠️
internal/telemetry/anonymity.go 97.87% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

📦 Build Artifacts

Workflow Run: View Run
Branch: feat/tpa-telemetry-tray-qa

Available Artifacts

  • archive-darwin-amd64 (28 MB)
  • archive-darwin-arm64 (26 MB)
  • archive-linux-amd64 (17 MB)
  • archive-linux-arm64 (15 MB)
  • archive-windows-amd64 (28 MB)
  • archive-windows-arm64 (25 MB)
  • frontend-dist-pr (0 MB)
  • installer-dmg-darwin-amd64 (22 MB)
  • installer-dmg-darwin-arm64 (20 MB)

How to Download

Option 1: GitHub Web UI (easiest)

  1. Go to the workflow run page linked above
  2. Scroll to the bottom "Artifacts" section
  3. Click on the artifact you want to download

Option 2: GitHub CLI

gh run download 30998970239 --repo smart-mcp-proxy/mcpproxy-go

Note: Artifacts expire in 14 days.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

QA verified: full test matrix + race green, API e2e pass, live tray verification via mcpproxy-ui-test with before/after captures, 11-agent adversarial review (7 findings fixed), codex cross-review CLEAN (round 2). qa-gate success at this SHA.

@github-actions
github-actions Bot merged commit da42d22 into main Aug 5, 2026
41 checks passed
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.

2 participants