Files
obsidian-vault/work/projects/cpm-pr0-episode-telemetry-summary-2026-10-16.md
T

5.6 KiB
Executable File

title, date, tags
title date tags
CPM PR0 — complete telemetry change 2026-10-16
work
cpm
telemetry

CPM PR0: one terminal report per failure episode

This describes the uncommitted replacement in alex/cpm-telemetry-pr0, based on origin/main (874b465856ca). It is a proposed revision of PR0 #7376, not a description of that PR's currently published diff.

Change and purpose. Replace the initialization-failed, stuck, recovered-with/without-reload and CPM post-reload-failure pixels with web_extension_cpm_episode. Put the initial failure and observed outcome together, avoiding reconstruction of a failure/recovery chain from separate events.

The first timeout opens an existing monitor episode and captures one diagnostic snapshot. Later failures update local stuck/reload state. A qualifying dashboard response or a five-minute deadline emits the terminal report. The new timer closes quiet episodes without waiting for another navigation; closing an episode cancels its timer and prevents duplicate reports. Stuck detection and automatic reload triggers retain their existing rules.

Five added summary parameters.

  • reason: the first timeout's context — session_restoration, tab_crash, extension_reload or other. Previously encoded in failure pixel names.
  • was_stuck: whether a later eligible non-restoration navigation, begun after the first failure, also timed out.
  • outcome: failed_measurement_response for the measurement that timed out; failed_tab_response for a later measurement on a failing tab; other_tab_response for another tab; unattributed_response for an ambiguous current-document match; or no_response_before_deadline.
  • reload_state: none (no reload observed), pending (replacement started), failed (replacement failed), loaded (replacement loaded), or response_timed_out (its first eligible messaging measurement timed out). Loaded alone does not prove messaging recovery.
  • response_after: elapsed time since the first failure, bucketed as under_30s, 30s_to_1m or 1m_to_deadline. Omitted for the no-response outcome.

Eight retained diagnostic booleans. All are captured at the first failure; unavailable facts are omitted.

  • context_loaded — extension context loaded; bg_view_alive — current background view exists.
  • bg_process_alive — its process is alive; bg_process_responsive — WebKit considers it responsive.
  • tab_in_context — failing tab registered in WebKit; handler_registered — autoconsent native handler registered.
  • tab_controller_match — tab and context controllers match; tab_has_ext_scripts — extension scripts remain registered.

Standard metadata remains: appVersion on both platforms, plus pixelSource and channel on macOS.

Parameters removed from transmission. context_errors, network_restarted, critical_memory_age, bg_view_creations, bg_view_leaked_count, app_version_change, app_launch_age, background_graveyard_enabled and recovery_from. Episode state and response attribution replace recovery_from. Graveyard attribution is also removed from the diagnostic model and monitor.

Retained lifecycle history. bg_events is included alongside the eight booleans, using the existing encoder: the latest 12 events at the first failure, oldest first, as sanitized token@age entries. Ages use 30s, 1m, 2m, 5m, 15m and over_15 buckets; older entries are dropped to keep the value within 255 characters. The timeline can contain error descriptors. Later failures and recovery do not replace or append to this snapshot. This preserves lifecycle ordering for diagnosis; combinations of timeline and scalar fields may still be correlatable.

Frequency and platform wiring. Both adapters use the same base event name, with no added _macos suffix. Keep daily+count: the first completed episode of the day sends both legs with identical parameters; subsequent episodes send count only. Daily deduplication is by event name, not reason/outcome, so daily estimates overall affected installations rather than unique installations for every outcome.

Definition cleanup. Remove 11 retired CPM pixel definitions and 9 unused parameter dictionary entries per platform; retain the background_events dictionary entry on both. The separate debug_web_extension_reload_failed remains emitted by the extension manager.

Scope and limits. This local revision does not include the original #7376 additions: bg_ready_after, bg_view_age, bg_load_error_after, bg_load_error_app_state, app_state, open_tabs, loading_tabs, recovery_document or recovery_after. Missing diagnostic facts need an explicit follow-up decision; fix-specific application/outcome metrics belong in the relevant fix PRs. Preventive-fix metrics must include eligible attempts that succeed without a failure episode.

A dashboard response proves neither document-level initResp delivery nor recovery of every failing tab. A deadline reports absence of qualifying evidence, not that all tabs died. Unfinished episodes can be lost when the monitor is released or the process exits.

Validation. All 742 WebExtensions package tests passed on macOS. Coverage includes first-failure timeline preservation, empty-timeline omission, response attribution, reload generations, deadline-only reporting, duplicate prevention, payload allowlisting and absence of graveyard attribution. macOS PixelKitMock checks, both platform definition validators, wide-event consistency checks and strict SwiftLint passed.

Related: cpm-status-2026-10-15, cpm-readiness-telemetry-tech-design-2026-10-15.