Skip to content

feat(testcentre): master "Diagnostics capture" switch to gate on-device research artifacts#702

Open
pipiche38 wants to merge 2 commits into
ryanbr:mainfrom
pipiche38:diagnostics-capture-toggle
Open

feat(testcentre): master "Diagnostics capture" switch to gate on-device research artifacts#702
pipiche38 wants to merge 2 commits into
ryanbr:mainfrom
pipiche38:diagnostics-capture-toggle

Conversation

@pipiche38

Copy link
Copy Markdown

Summary

Adds a single "Diagnostics capture" master switch to Test Centre → Diagnostic tools (default OFF, opt-in). Today the Oura Tier-B JSONL sidecars are always-on and fill /OpenWhoop/Diagnostics during normal use; this puts every on-device research artifact behind one switch a tester flips on for a capture session.

Motivation

The Diagnostics folder accumulates artifacts (oura-activity, and — on other branches — oura-ibihr / oura-raw, plus the WHOOP raw-frame capture) with no user control. A single opt-in switch keeps the folder empty in normal use and gives a clean way to arm capture only when debugging.

What changed

  • Shared pref key noopDiagnosticsCapture — identical string on both platforms (Swift PuffinExperiment.diagnosticsCaptureKey / Kotlin PuffinExperiment.KEY_DIAGNOSTICS_CAPTURE), following the existing PuffinExperiment cross-platform idiom.
  • Oura sidecars gated — OuraActivityDump is only created when the switch is on (both platforms), so default-off writes no sidecar file. Future oura-ibihr / oura-raw honor the same key when they merge.
  • WHOOP raw-frame capture folded in — a new rawCaptureActive helper (per-strap enableRawCapture/isCaptureEnabled OR the master) drives the 24/7 capture gate, so the master switch turns raw capture on too while the independent per-strap flag keeps working. The on-demand bounded raw-capture window is untouched.
  • Test Centre UI — a toggle in the Diagnostic tools card on both platforms (Swift @AppStorage, Kotlin Switch), with copy explaining it applies on the next connection.

Cross-platform parity

Symmetric Swift/Kotlin: same pref key, same gate placement (dump creation + raw-capture guard), same UI toggle. No stored-data or analytics change, so nothing crosses the .noopbak boundary.

Behavior change

The Oura activity/MET sidecar was always-on and is now OFF by default — testers must enable the switch before a capture night. This is the intended effect (stop the folder filling).

Scope / notes

  • Takes effect on the next ring/strap connection (read where each dump/capture is created), not mid-session.
  • No protocol change — the raw-capture edits only widen a read-only capture gate; no BLE write, no connection-path change.
  • On this branch only oura-activity exists to gate; oura-ibihr / oura-raw live on the combined/anchor branches and plug into the same key on merge.

Verification

  • App-target Swift (CI doesn't cover it): Strand macOS xcodebuild … build → BUILD SUCCEEDED.
  • Android: compileFullDebugKotlin → clean.
  • Design system: toggle uses StrandPalette/StrandFont (Swift) and Palette/NoopType (Android) — no hardcoded colors/fonts.
  • 9 files, single commit 5e3fb4d.
  • On-device: pending your confirmation that flipping it toggles the oura-activity sidecar on/off.

@pipiche38
pipiche38 force-pushed the diagnostics-capture-toggle branch 2 times, most recently from c115a41 to bc61f9f Compare July 24, 2026 17:47
pipiche38 and others added 2 commits July 25, 2026 09:42
…ce research artifacts

The app writes several research artifacts to <App Support>/OpenWhoop/Diagnostics with
no user control: the Oura Tier-B JSONL sidecars (oura-activity today; oura-ibihr /
oura-raw on their own branches) plus the WHOOP 5/MG raw-frame capture. The Oura
sidecars were always-on, so the folder fills up during normal use.

Add a single "Diagnostics capture" master switch in the Test Centre → Diagnostic tools
(default OFF, opt-in), so nothing is captured unless a tester turns it on for a session:
- New shared pref key `noopDiagnosticsCapture` (Swift PuffinExperiment.diagnosticsCaptureKey
  / Kotlin PuffinExperiment.KEY_DIAGNOSTICS_CAPTURE) — same string both platforms.
- Oura sidecar creation (OuraLiveSource, both platforms) is gated on the master switch, so
  the default-off state writes no sidecar file.
- WHOOP raw-frame capture ORs the master into its existing gate via `rawCaptureActive`
  (= per-strap enableRawCapture/isCaptureEnabled OR the master), so the master turns raw
  capture on too while the independent per-strap flag keeps working. The on-demand bounded
  raw-capture window is untouched (always honoured).
- Test Centre toggle on both platforms (Swift @AppStorage, Kotlin Switch), mirroring the
  existing PuffinExperiment cross-platform idiom.

All new UI copy is fully localized — no hardcoded strings: the two toggle strings are
extracted to Strand/Resources/Localizable.xcstrings (Apple) and values/strings.xml +
values-de/es/fr/zh (Android), passing Tools/i18n_audit.py --ci.

Takes effect on the next ring/strap connection (read where each dump/capture is created).
No protocol change; the raw-capture edits only widen a read-only capture gate.

Behavior change: the Oura activity/MET sidecar was always-on and is now OFF by default.

Built: Strand macOS BUILD SUCCEEDED; Android compileFullDebugKotlin clean; i18n audit green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016DN6cU2ERWZUS9tWYCjPvi
The Diagnostics-capture switch's copy was added without pt-PT, which the i18n gate (now that `main`'s
LANGS includes pt-PT) flags on both platforms: `Strand/Resources/Localizable.xcstrings` pt-PT missing=2
and `values-pt-rPT/strings.xml` missing the two keys. Add the European-Portuguese translations of
"Diagnostics capture" and the research-artifacts explainer.

`python3 Tools/i18n_audit.py --ci origin/main` now exits 0 (all focus locales de/es/fr/pt-PT complete).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AtXcBU1t6Xk1qJhaQEeDx6
@pipiche38
pipiche38 force-pushed the diagnostics-capture-toggle branch from d7ce999 to e419b82 Compare July 25, 2026 07:43
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.

1 participant