Skip to content

feat(desktop): outcome-based, build-attributable macOS release-health telemetry (#10425) - #10443

Merged
Git-on-my-level merged 11 commits into
mainfrom
agent/m1-studio-omp-glm-5-2/cf137bae
Jul 24, 2026
Merged

Git-on-my-level merged 11 commits into
mainfrom
agent/m1-studio-omp-glm-5-2/cf137bae

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Jul 23, 2026 •

Copy link
Copy Markdown
Member

macOS release-health telemetry: outcome-based, build-attributable, privacy-safe

Closes #10425

Makes macOS desktop release-health telemetry outcome-based, build-attributable, and
safe to use for release decisions
. Observability-contract only — no product behavior,
provider, PTT UX, release-promotion, or backend change.

Product invariants affected

Path globs are touched by telemetry-only edits (labels, correlation keys, init) — no
lifecycle state machine, auth-session, or chat-continuity behavior change:

  • INV-AUTH-1 — AuthService.swift (fallback area label), OmiApp.swift (Sentry init).
  • INV-CHAT-1 — AgentRuntimeProcess.swift, FloatingBarVoicePlaybackService.swift,
    PTTAttemptLifecycleRecorder.swift, RealtimeHubController*.swift (telemetry keys/labels).
  • INV-VOICE-1 — RealtimeHubController.swift, FloatingBarVoicePlaybackService.swift
    (optional mint_attempt_id correlation + a fallback area label; no new lifecycle owner).

Root cause

Several high-volume desktop signals were intermediate lifecycle events or ambiguous
terminal states, so a healthy path could resemble a user-visible regression:

  • floating_bar_ptt_ended collapsed four causally distinct PTT outcomes (accidental
    tap, deliberate quiet discard, dead-mic capture failure, empty-after-commit) into one
    had_transcript boolean; the classified ptt_audio_capture_lifecycle funnel
    suppressed success remotely, so there was no queryable success denominator.
  • realtime_token_mint_failed had no terminal outcome and no correlation key, so a
    mint failure that recovered could not be told apart from one that exhausted to
    the cascade; phase was an open string.
  • fallback_triggered reported area=other, reason=capability_mismatch for 32/255
    users — the benign ProactiveAssistants screen-capture flap mixed with genuinely
    degraded paths under one other bucket.
  • Expected realtime idle teardown / session rotation were separate events but had no
    single field excluding them from error rollups.
  • Sentry never set options.release/options.dist; native crash/hang/watchdog events
    were unfilterable by version/build, and beta+stable were indistinguishable
    (environment=production). PostHog registered no global identity, so most events
    (incl. floating_bar_ptt_ended) carried no release cohort.
  • No versioned release-health metric spec existed.

What changed (one authoritative owner, bounded schemas, no second state machine)

  • PTT funnel (ptt_audio_capture_lifecycle, schema v2): emit every terminal
    disposition remotely — including committed success — so the success denominator is
    queryable. failure_class separates capture_never_operational (real failure) from
    released_before_usable_audio/too_short_audible (short tap), cancelled, and
    zero_or_near_zero_samples+silent_rejected (quiet discard). floating_bar_ptt_ended
    is deprecated as a denominator (retained for backward compatibility).
  • Realtime mint: bucket phase to a closed set (warm vs barge_in_replacement);
    add optional outcome + mint_attempt_id so a mint failure joins its
    recovered/degraded/exhausted fate on the correlated realtime_hub fallback event
    (wired on all 3 warm + 3 barge-in mint paths).
  • Realtime provider close: add bounded expected + lifecycle_class so expected
    idle teardown / planned session rotation are excluded from error rollups but stay
    inspectable (they remain non-Sentry).
  • Fallback: add named owners (screen_capture, memory_scope, desktop_update,
    tts_fallback, task_workflow, auth_storage) and update callers so known paths
    stop collapsing into area=other. recovered stays distinct from degraded/exhausted.
  • Release attribution: Sentry options.releaseName = AppBuild.releaseTag
    (v{ver}+{build}-macos), options.dist = currentUpdateChannel, plus global
    update_channel/bundle_id scope tags; PostHog registers
    app_version/app_build/update_channel super-properties (and mirrors them onto
    identify()), so every event is release-attributable.
  • Privacy guard: a content-bearing-key blocklist at the single record() emit
    chokepoint strips transcript/audio/prompt/response/message/detail_reason/
    error-text keys; bounded cousins (transcript_length, failure_class) survive.
  • Spec: desktop/macos/docs/release-health-metrics.md — versioned query contract
    (numerator, denominator, window, minimum cohort, missing-data, comparison) for PTT,
    realtime, fallback, crash, updater, recording, memory, aligned to
    desktop_release_doctor_report.METRIC_CONTRACTS.

Recurrence / similar-case audit

A parallel Phase-A discovery swarm (4 read-only scouts) mapped every producer/consumer
of PTT, realtime, fallback, and Sentry/PostHog telemetry, then a refutation pass
discarded disproven/duplicate/out-of-scope candidates. The auditor confirmed the only
remaining area=other+capability_mismatch path is the benign screen-capture flap (now
its own area), and that realtime_hub capability-mismatch paths already stay in-area.

Durable guard

The record() content-key blocklist is the single chokepoint every health snapshot
(local ring buffer + remote PostHog) flows through, so a future caller that threads a
content-bearing key through extra is stripped by construction — defended by
testHealthEventsStripContentBearingKeysButKeepBoundedCousins and
testWalUploadFailureStripsFreeFormDetailReason (the latter targets the real
String(describing: error) provenance).

Source ownership

DesktopDiagnosticsManager remains the one health-event owner; no second enum, state
machine, or analytics path is introduced. INV-VOICE-1: the only changes to
RealtimeHubController.swift / FloatingBarVoicePlaybackService.swift add telemetry
correlation keys (mint_attempt_id) and a fallback-area label — no lifecycle state,
current-turn variable, or timer.

Privacy boundary

Only bounded dimensions/strings are emitted. No transcript, audio, prompt, device
identifier, or free-form local error text reaches PostHog properties or Sentry
tags/contexts (content-key blocklist + the existing allowedIncidentExtraKeys
allowlist for Sentry incidents). Tests prove it.

Tests

New contract tests in DesktopDiagnosticsManagerTests: PTT committed success
denominator (schema v2), realtime phase bucketing + outcome/mint_attempt_id, expected
lifecycle flag, named fallback areas, content-key stripping (+ bounded cousin
survival), and WAL free-form detail_reason stripping.

Verification evidence

  • swift build clean (executable + test target, strict concurrency / warnings-as-errors).
  • DesktopDiagnosticsManagerTests 28/28, PTTAttemptLifecycleRecorderTests 18/18,
    RealtimeHubSessionHandoffPolicyTests 20/20.
  • make preflight: 9/9 checks pass (incl. product-invariants, failure-class-protocol,
    deferred-work-markers).
  • Real user-facing path: the changed telemetry is isDevBuild-gated (remote
    PostHog/Sentry and native handlers are disabled for dev bundles), and triggering a
    real mint failure / fallback / native crash needs a non-dev build plus live realtime
    providers and physical PTT — an interactive real path is genuinely impractical to
    observe here. Per the issue's allowance, behavioral production-seam tests exercising
    the real DesktopDiagnosticsManager.record* paths are retained instead. AppBuild.releaseTag
    format matches the Codemagic v{ver}+{build}-macos tag, and Sentry dSYM upload is
    UUID-based, so options.releaseName cannot break symbolication.

Review / critic outcomes

  • Adversarial critic (REQUEST-CHANGES → fixed): (A) privacy blocklist missed
    detail_reason (free-form WAL error text) — extended + test; (B) warm-mint failovers
    omitted mint_attempt_id, breaking the majority-path join — wired; (C) an off-by-2
    edit had dropped a CredentialHealthManager.record call in the barge-in catch —
    restored. Re-verified green.
  • Independent code reviewer: APPROVE (correctness: correct). One P3 doc nit (Sentry
    dist mislabeled as build carrier) — fixed.

Deliberate deferrals (not in scope)

  • Rust fallback::record_fallback is referenced by docs/agents/fallback-telemetry.md
    but unimplemented in sdks/rust/ — backend/SDK contract-doc gap, not macOS.
  • PostHog/Sentry dashboard provisioning, Sentry-server config, backend release-evidence
    doctor wiring (#9523), beta auth/release-channel taxonomy (#9160), and the concrete
    .113 Sentry/memory/hang/Gemini fixes (#10420) are owned by their own issues; this
    PR supplies only the client-side outcome/attribution contract they consume.
  • Cross-namespace join (PTT lifecycle int attempt_id ↔ realtime voice_turn_terminal
    UUID) is documented as follow-up — not required by the acceptance criteria.

Failure-Class: none

Review in cubic

Make macOS desktop health telemetry outcome-based and queryable so intermediate
lifecycle events and expected noise cannot be read as customer-visible regressions.

- PTT funnel: emit ptt_audio_capture_lifecycle remotely for every terminal
  disposition (including committed success) so a release-health query has a success
  denominator; short tap / quiet discard / cancel are distinct failure_class values,
  not unexplained no-transcript failures. telemetry_schema_version -> 2. The ambiguous
  floating_bar_ptt_ended had_transcript event is deprecated as a denominator.
- Realtime mint: bucket phase to a closed set (warm vs barge_in_replacement); add
  optional outcome + mint_attempt_id so a mint failure joins its recovered/degraded/
  exhausted fate on the correlated realtime_hub fallback event.
- Realtime provider close: add bounded expected/lifecycle_class so expected idle
  teardown and planned session rotation are excluded from error rollups (they remain
  separately inspectable, never Sentry-reported).
- Fallback: add named owners (screen_capture, memory_scope, desktop_update,
  tts_fallback, task_workflow, auth_storage) so known paths stop collapsing into
  area=other; #10425's area=other/capability_mismatch cohort is the benign
  ProactiveAssistants screen-capture flap, now its own area.
- Privacy: content-bearing keys (transcript/audio/prompt/response/message/...) are
  stripped at the single record() emit chokepoint; bounded cousins like
  transcript_length survive.

INV-VOICE-1: changes to RealtimeHubController.swift / FloatingBarVoicePlaybackService.swift
add telemetry correlation keys + a fallback area label only; no new lifecycle state
machine, current-turn variable, or completion timer.

Verification: swift build clean; DesktopDiagnosticsManagerTests 27/27,
PTTAttemptLifecycleRecorderTests 18/18, RealtimeHubSessionHandoffPolicyTests 20/20.
…0425)

Native Sentry crash/app-hang/watchdog events were unfilterable by version/build and
beta+stable were indistinguishable (both report environment="production"); PostHog
registered no global identity so most events (incl. floating_bar_ptt_ended) carried
no release cohort.

- Sentry: set options.releaseName = AppBuild.releaseTag (v{ver}+{build}-macos, the
  Codemagic tag) and options.dist = AppBuild.currentUpdateChannel at SentrySDK.start,
  and tag every event (including native) with update_channel + bundle_id via a global
  scope.
- PostHog: register app_version/app_build/update_channel as super-properties so every
  captured event is release-attributable; mirror app_build/update_channel onto the
  identify() person properties.

No user content is added: only bounded version/build/channel strings.
Add desktop/macos/docs/release-health-metrics.md: the authoritative query contract
defining, per signal (PTT, realtime mint, realtime session, fallback, crash, updater,
recording, memory), the exact numerator, denominator, time window, minimum cohort,
unknown/missing-data behavior, and release-comparison rule. Aligns to
desktop_release_doctor_report.METRIC_CONTRACTS and documents the uniform
Sentry/PostHog release-identity keys.
Add contract tests proving the #10425 semantics:
- PTT committed success is recorded in the funnel (schema v2 denominator).
- Realtime mint phase buckets to the closed set and carries outcome/mint_attempt_id.
- Realtime provider close marks expected vs error lifecycle_class.
- Named fallback areas (screen_capture/memory_scope/...) are not collapsed to other.
- Content-bearing keys (transcript/audio/prompt/response/message) are stripped at the
  emit chokepoint while the bounded transcript_length cousin survives.
…view (#10425)

Address three findings from the post-implementation adversarial critic:

- Realtime mint join (warm path): pass mint_attempt_id to the warm-mint
  failoverToAlternateProvider calls so the recovered/degraded/exhausted outcome is
  joinable on the majority (background pre-warm) path, not only barge-in.
- Restore CredentialHealthManager.shared.record in the barge-in CredentialHealthError
  catch (an off-by-2 edit had dropped it); credential-health observability for that
  path is preserved.
- Privacy: extend the content-bearing key blocklist to include detail_reason/detail/
  error_description/localized_description/description so free-form error text piped
  through detail_reason (e.g. WALService upload String(describing:)) cannot reach
  PostHog; bounded failure_class/area/reason are retained. Add a regression test.

Verification: swift build clean; DesktopDiagnosticsManagerTests 28/28,
PTTAttemptLifecycleRecorderTests 18/18, RealtimeHubSessionHandoffPolicyTests 20/20.
…table (#10425)

Sentry `dist` carries the release channel (stable/beta), not the app build; the build
is carried only by the `release` tag. Drop the misleading `/ dist` from the App-build
row so a release-health query does not slice by channel instead of build.
- Raise the product file line-count ratchet baselines for the three telemetry-touched
  files (RealtimeHubController.swift, RealtimeHubController+SessionLifecycle.swift,
  OmiApp.swift) with one-line justifications; the growth is bounded telemetry wiring.
- Add an unreleased desktop changelog fragment for the release-health diagnostics change.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f51130ef61

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

if self.failoverBargeInReplacement(from: provider, reason: "other") {
phase: "barge_in_replacement",
mintAttemptId: String(mintGeneration))
if self.failoverBargeInReplacement(from: provider, reason: "other", mintAttemptId: String(mintGeneration)) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Emit exhausted fallback when barge-in mint cannot fail over

When a barge-in replacement mint fails after the hub is already on the alternate provider (so fallbackProvider != nil) or otherwise cannot start an alternate, failoverBargeInReplacement returns false and the code immediately calls failBargeInReplacement without emitting a correlated fallback_triggered outcome. The new realtime_token_mint_failed event has a mint_attempt_id, but release-health queries then have nothing to join it to for the terminal exhausted fate, undercounting active-turn realtime mint failures; record the exhausted realtime_hub fallback before failing the replacement.

AGENTS.md reference: desktop/macos/AGENTS.md:L48-L49

Useful? React with 👍 / 👎.

@Git-on-my-level

Copy link
Copy Markdown
Member Author

@cursor address merge conflict and review comment

@cursor

cursor Bot commented Jul 24, 2026 •

Copy link
Copy Markdown

Addressed both items from the review thread.

Merge conflict

Merged origin/main and resolved the conflict in desktop-swift-floatingcontrolbar.json:

  • Kept the RealtimeHubController.swift baseline (1534 lines; still over threshold)
  • Dropped RealtimeHubController+SessionLifecycle.swift from the baseline (1471 lines after main’s extraction — under threshold)
  • Accepted main’s DashboardPage.swift baseline lowering (home-stage refactor)

Codex review (P2): exhausted fallback when barge-in mint can’t fail over

Mirrored the existing failoverToAlternateProvider pattern in failoverBargeInReplacement:

  • When fallbackProvider != nil (already on the alternate), record an exhausted realtime_hub fallback with mint_attempt_id before returning false
  • When signed-out after a degraded failover attempt, record exhausted before returning false
  • Added recordBargeInReplacementFailoverExhausted helper to avoid duplication

This lets realtime_token_mint_failed join its terminal exhausted outcome via mint_attempt_id for release-health queries.

Test

Added testBargeInFailoverExhaustedWhenAlternateProviderAlreadyActive in RealtimeHubSessionHandoffPolicyTests.

Verification

  • make preflight: 19/19 checks pass
  • Swift tests require macOS CI (no xcrun in this Linux environment)

Pushed to agent/m1-studio-omp-glm-5-2/cf137bae — PR #10443 updated.

Open in Web Open in Cursor 

cursoragent and others added 3 commits July 24, 2026 01:15
…10425)

Merge origin/main and resolve the floatingcontrolbar line-count ratchet
conflict (keep RealtimeHubController baseline; SessionLifecycle is below
threshold after main's extraction).

Address Codex review: when failoverBargeInReplacement cannot start an
alternate (already on fallback provider or signed out after degraded),
record an exhausted realtime_hub fallback with mint_attempt_id so
realtime_token_mint_failed joins its terminal outcome.

Verification: make preflight (post-commit); testBargeInFailoverExhaustedWhenAlternateProviderAlreadyActive (macOS CI).

Co-authored-by: David Zhang <[email protected]>
…mainactor (#10425)

Merge origin/main for CI freshness. Mark testBargeInFailoverExhaustedWhenAlternateProviderAlreadyActive
@mainactor to match RealtimeHubController isolation.

Prior Desktop Swift CI failure was a 60m job timeout during parallel swift-test-suites
after test bundle link (TEST_RESULT=cancelled), not a compile or assertion failure.

Co-authored-by: David Zhang <[email protected]>
@Git-on-my-level

Copy link
Copy Markdown
Member Author

@cursor address failing CI and fix any other issues you find

@cursor

cursor Bot commented Jul 24, 2026 •

Copy link
Copy Markdown

Here’s what I found and what I changed.

CI root cause

Desktop Swift Build & Tests did not fail on a compile or XCTest assertion. The Desktop Swift Test Suites job hit the 60-minute workflow limit and was cancelled while swift-test-suites.sh was running after Build complete! (~53 minutes with no further log output). The aggregate job then failed because TEST_RESULT=cancelled.

On the earlier run, launcher harness tests logged a 4s build-lock timeout in a negative-control fixture but still reported 18 passed, 0 failed — not a product test failure.

A re-run after our push was cancelled when PR #10443 merged (2026-07-24T02:38:53Z), so those checks never reached a clean green/red verdict on the final push.

Fixes applied (pushed to bae0b2ceff)

  1. Merged origin/main into the branch (includes latest desktop/chat fixes).
  2. @MainActor on testBargeInFailoverExhaustedWhenAlternateProviderAlreadyActive so it matches RealtimeHubController isolation.
  3. make preflight: 19/19 checks pass locally.

The Codex exhausted-fallback change from the prior turn is unchanged and still covered by that test.

Status

PR #10443 is merged. If you need a definitive Desktop Swift CI signal on main, re-run Desktop Swift CI on the merge commit or watch the next main push — the failure mode we saw was infra timeout / merge cancellation, not a reproduced Swift defect in the retained logs.

Open in Web Open in Cursor 

@Git-on-my-level
Git-on-my-level merged commit c24e5f6 into main Jul 24, 2026
25 of 27 checks passed
@Git-on-my-level
Git-on-my-level deleted the agent/m1-studio-omp-glm-5-2/cf137bae branch July 24, 2026 02:38
undivisible pushed a commit to undivisible/omi that referenced this pull request Sep 29, 2026
… telemetry (BasedHardware#10425) (BasedHardware#10443)

# macOS release-health telemetry: outcome-based, build-attributable,
privacy-safe

Closes BasedHardware#10425

Makes macOS desktop release-health telemetry **outcome-based,
build-attributable, and
safe to use for release decisions**. Observability-contract only — no
product behavior,
provider, PTT UX, release-promotion, or backend change.

## Product invariants affected

Path globs are touched by telemetry-only edits (labels, correlation
keys, init) — no
lifecycle state machine, auth-session, or chat-continuity behavior
change:

- INV-AUTH-1 — `AuthService.swift` (fallback area label), `OmiApp.swift`
(Sentry init).
- INV-CHAT-1 — `AgentRuntimeProcess.swift`,
`FloatingBarVoicePlaybackService.swift`,
`PTTAttemptLifecycleRecorder.swift`, `RealtimeHubController*.swift`
(telemetry keys/labels).
- INV-VOICE-1 — `RealtimeHubController.swift`,
`FloatingBarVoicePlaybackService.swift`
(optional `mint_attempt_id` correlation + a fallback area label; no new
lifecycle owner).

## Root cause

Several high-volume desktop signals were intermediate lifecycle events
or ambiguous
terminal states, so a healthy path could resemble a user-visible
regression:

- `floating_bar_ptt_ended` collapsed four causally distinct PTT outcomes
(accidental
tap, deliberate quiet discard, dead-mic capture failure,
empty-after-commit) into one
`had_transcript` boolean; the classified `ptt_audio_capture_lifecycle`
funnel
suppressed success remotely, so there was no queryable success
denominator.
- `realtime_token_mint_failed` had no terminal outcome and no
correlation key, so a
mint failure that **recovered** could not be told apart from one that
**exhausted** to
  the cascade; `phase` was an open string.
- `fallback_triggered` reported `area=other, reason=capability_mismatch`
for 32/255
users — the benign ProactiveAssistants screen-capture flap mixed with
genuinely
  degraded paths under one `other` bucket.
- Expected realtime idle teardown / session rotation were separate
events but had no
  single field excluding them from error rollups.
- Sentry never set `options.release`/`options.dist`; native
crash/hang/watchdog events
were unfilterable by version/build, and beta+stable were
indistinguishable
(`environment=production`). PostHog registered no global identity, so
most events
  (incl. `floating_bar_ptt_ended`) carried no release cohort.
- No versioned release-health metric spec existed.

## What changed (one authoritative owner, bounded schemas, no second
state machine)

- **PTT funnel** (`ptt_audio_capture_lifecycle`, schema v2): emit every
terminal
disposition remotely — including committed success — so the success
denominator is
queryable. `failure_class` separates `capture_never_operational` (real
failure) from
`released_before_usable_audio`/`too_short_audible` (short tap),
`cancelled`, and
`zero_or_near_zero_samples`+`silent_rejected` (quiet discard).
`floating_bar_ptt_ended`
  is deprecated as a denominator (retained for backward compatibility).
- **Realtime mint**: bucket `phase` to a closed set (`warm` vs
`barge_in_replacement`);
  add optional `outcome` + `mint_attempt_id` so a mint failure joins its
recovered/degraded/exhausted fate on the correlated `realtime_hub`
fallback event
  (wired on all 3 warm + 3 barge-in mint paths).
- **Realtime provider close**: add bounded `expected` +
`lifecycle_class` so expected
idle teardown / planned session rotation are excluded from error rollups
but stay
  inspectable (they remain non-Sentry).
- **Fallback**: add named owners (`screen_capture`, `memory_scope`,
`desktop_update`,
`tts_fallback`, `task_workflow`, `auth_storage`) and update callers so
known paths
stop collapsing into `area=other`. `recovered` stays distinct from
`degraded`/`exhausted`.
- **Release attribution**: Sentry `options.releaseName =
AppBuild.releaseTag`
(`v{ver}+{build}-macos`), `options.dist = currentUpdateChannel`, plus
global
  `update_channel`/`bundle_id` scope tags; PostHog registers
`app_version`/`app_build`/`update_channel` super-properties (and mirrors
them onto
  `identify()`), so every event is release-attributable.
- **Privacy guard**: a content-bearing-key blocklist at the single
`record()` emit
chokepoint strips
`transcript`/`audio`/`prompt`/`response`/`message`/`detail_reason`/
error-text keys; bounded cousins (`transcript_length`, `failure_class`)
survive.
- **Spec**: `desktop/macos/docs/release-health-metrics.md` — versioned
query contract
(numerator, denominator, window, minimum cohort, missing-data,
comparison) for PTT,
  realtime, fallback, crash, updater, recording, memory, aligned to
  `desktop_release_doctor_report.METRIC_CONTRACTS`.

## Recurrence / similar-case audit

A parallel Phase-A discovery swarm (4 read-only scouts) mapped every
producer/consumer
of PTT, realtime, fallback, and Sentry/PostHog telemetry, then a
refutation pass
discarded disproven/duplicate/out-of-scope candidates. The auditor
confirmed the only
remaining `area=other`+`capability_mismatch` path is the benign
screen-capture flap (now
its own area), and that `realtime_hub` capability-mismatch paths already
stay in-area.

## Durable guard

The `record()` content-key blocklist is the single chokepoint every
health snapshot
(local ring buffer + remote PostHog) flows through, so a future caller
that threads a
content-bearing key through `extra` is stripped by construction —
defended by
`testHealthEventsStripContentBearingKeysButKeepBoundedCousins` and
`testWalUploadFailureStripsFreeFormDetailReason` (the latter targets the
real
`String(describing: error)` provenance).

## Source ownership

`DesktopDiagnosticsManager` remains the one health-event owner; no
second enum, state
machine, or analytics path is introduced. INV-VOICE-1: the only changes
to
`RealtimeHubController.swift` / `FloatingBarVoicePlaybackService.swift`
add telemetry
correlation keys (`mint_attempt_id`) and a fallback-area label — no
lifecycle state,
current-turn variable, or timer.

## Privacy boundary

Only bounded dimensions/strings are emitted. No transcript, audio,
prompt, device
identifier, or free-form local error text reaches PostHog properties or
Sentry
tags/contexts (content-key blocklist + the existing
`allowedIncidentExtraKeys`
allowlist for Sentry incidents). Tests prove it.

## Tests

New contract tests in `DesktopDiagnosticsManagerTests`: PTT committed
success
denominator (schema v2), realtime phase bucketing +
outcome/mint_attempt_id, expected
lifecycle flag, named fallback areas, content-key stripping (+ bounded
cousin
survival), and WAL free-form `detail_reason` stripping.

## Verification evidence

- `swift build` clean (executable + test target, strict concurrency /
warnings-as-errors).
- `DesktopDiagnosticsManagerTests` 28/28,
`PTTAttemptLifecycleRecorderTests` 18/18,
  `RealtimeHubSessionHandoffPolicyTests` 20/20.
- `make preflight`: 9/9 checks pass (incl. product-invariants,
failure-class-protocol,
  deferred-work-markers).
- **Real user-facing path:** the changed telemetry is `isDevBuild`-gated
(remote
PostHog/Sentry and native handlers are disabled for dev bundles), and
triggering a
real mint failure / fallback / native crash needs a non-dev build plus
live realtime
providers and physical PTT — an interactive real path is genuinely
impractical to
observe here. Per the issue's allowance, behavioral production-seam
tests exercising
the real `DesktopDiagnosticsManager.record*` paths are retained instead.
`AppBuild.releaseTag`
format matches the Codemagic `v{ver}+{build}-macos` tag, and Sentry dSYM
upload is
  UUID-based, so `options.releaseName` cannot break symbolication.

## Review / critic outcomes

- **Adversarial critic** (REQUEST-CHANGES → fixed): (A) privacy
blocklist missed
`detail_reason` (free-form WAL error text) — extended + test; (B)
warm-mint failovers
omitted `mint_attempt_id`, breaking the majority-path join — wired; (C)
an off-by-2
edit had dropped a `CredentialHealthManager.record` call in the barge-in
catch —
  restored. Re-verified green.
- **Independent code reviewer**: APPROVE (correctness: correct). One P3
doc nit (Sentry
  `dist` mislabeled as build carrier) — fixed.

## Deliberate deferrals (not in scope)

- Rust `fallback::record_fallback` is referenced by
`docs/agents/fallback-telemetry.md`
but unimplemented in `sdks/rust/` — backend/SDK contract-doc gap, not
macOS.
- PostHog/Sentry dashboard provisioning, Sentry-server config, backend
release-evidence
doctor wiring (`BasedHardware#9523`), beta auth/release-channel taxonomy (`BasedHardware#9160`),
and the concrete
`.113` Sentry/memory/hang/Gemini fixes (`BasedHardware#10420`) are owned by their own
issues; this
PR supplies only the client-side outcome/attribution contract they
consume.
- Cross-namespace join (PTT lifecycle int `attempt_id` ↔ realtime
`voice_turn_terminal`
UUID) is documented as follow-up — not required by the acceptance
criteria.

Failure-Class: none


<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/BasedHardware/omi/pull/10443?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="Review in cubic"
src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->
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.

macOS: make release-health telemetry outcome-based and build-attributable

2 participants