Skip to content

fix(watch): preserve recording recovery copies until iPhone receipt - #22059

Merged
kodjima33 merged 10 commits into
mainfrom
fix/20479-watch-recording-recovery
Oct 20, 2026
Merged

kodjima33 merged 10 commits into
mainfrom
fix/20479-watch-recording-recovery

Conversation

@aryanorastar

@aryanorastar aryanorastar commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator

What changed and why

Apple Watch audio arriving after Stop or an iPhone process restart can be discarded by the live recording-state gate. The Watch previously kept no original file. #21072 removed the iPhone's whole-session memory growth, but did not address durable transfer or recovery. Refs #20479; keep the incident open pending the customer's original-audio investigation.

This adds an independent recovery path while retaining live transcription:

  • Compact consumed Data slices and drain temporary buffers during capture/validation/recovery/digest reads, preventing session-sized native memory retention.
  • Save session-fenced PCM segments on Watch before live routing, with periodic fsync, bounded file size, interrupted-write recovery and storage-failure feedback.
  • Transfer finalized files in the background and keep Watch originals until the iPhone persists an account-owned copy and acknowledges its digest. Receive files after Stop/restart without restarting a microphone.
  • Keep durable receipts after processing/deletion so retries cannot recreate removed backups, and require those receipts before the iPhone recordings scanner lists a file for its original account.
  • Preserve the user’s explicit Process Now choice for a single Watch recovery file, using the existing phone keep/restore path so recovered speech does not become an automatically discarded conversation. Automatic, malformed-marker and mixed/bulk uploads keep their existing policy.
  • Show pending transfers and Retry transfer on Watch. Stop the recording indicator when capture is interrupted or stops supplying frames.
  • Isolate damaged/oversized partials, preserve conflicting originals, and fairly retry current-account files using monotonic backoff so a few missing receipts cannot starve later segments.

Recovery copies use the existing local Recordings playback and Process Now pipeline. Processing remains manual to avoid automatically duplicating a successful live conversation. Both mobile companions need release. The existing format is supported, but the new explicit keep rule also requires deploying the shared sync processing backend. It cannot reconstruct audio that an older Watch app never saved, and does not promise one eleven-hour conversation.

Architecture, implementation and rollout checklist: app/docs/apple-watch-recovery.md.

Validation

  • Real sync API route/PCM decode test passed: upload a Watch-format file, run the shared coordinator, poll completion, then read back a visible user-kept conversation with external STT/cloud seams faked.
  • Backend keep/restore regression: both Watch cases failed before the change; all 13 phone/Watch selection, bulk-policy and deletion/failure tests passed after it.
  • Native recovery harness (18 tests passed): round-trip bytes/framing, rotation, out-of-order reception, interrupted writes, stale session callbacks, storage pressure, account binding, corrupt files, digest conflicts, retry after user deletion, damaged/oversized partial isolation, transfer fairness, and bounded writer/receipt-cleanup memory.
  • Flutter: 43 focused tests, 138 protected spine tests and all 23 selected hermetic journey cases passed; analyzer ratchet passed without baseline edits.
  • Full iPhone simulator Debug-dev build passed with Flutter 3.44.5 / Xcode 27.1; the real companion target also built arm64 + arm64_32. An unsigned Release-dev device build also passed, with the Watch app embedded in Runner.app (iPhone arm64; Watch arm64 + arm64_32). Signed installation/store release is still pending.
  • Accelerated 11h06m custody test passed: 666 one-minute files, 3,996,000 frames, 1,294,704,000 framed bytes, every iPhone digest matched and Watch cleanup occurred only after receipts. Peak RSS fell from >1 GB to 23,920,640 bytes. This does not qualify microphone/radio/battery behavior on hardware.
  • Actual Watch sources typechecked; the real Watch view/controller/store also built in an isolated simulator target. UI screenshots use synthetic recorder state on the 40 mm Watch simulator.
  • Existing Watch presentation and stateless relay regression tests passed.
  • Normal pre-push passed, including 55 preflight checks, backend typechecking (zero errors), selected backend tests and generated-file checks. The local 90-day history audit skipped on the shallow checkout; CI used full history.
  • CI passed on ca035fc9ac0cd7ba2b07435f1075ee9f948fc5a5: Mobile App Checks (including pinned Xcode 26.6 iOS compile and required Mobile Release Eligibility), Backend Unit Tests, Backend Hermetic E2E, API contracts, runtime source closure, and latest PR Metadata Preflight. An older metadata run was superseded/cancelled; its replacement passed.

Merge with current main (10ef495, checklist 4848528, harness db25f6b)

Merged origin/main at a87589a with a merge commit (no rebase, no force-push).

  • app/ios/Runner.xcodeproj/project.pbxproj: resolved by hand, not by taking either side. Kept main's entries, including the SafeFoundationSinks.swift file ref/build files and SiriSession. Kept this PR's WatchRecordingStore.swift ref and its three build files, plus the Watch target's SafeFoundationSinks.swift build file pointing at main's file ref. Dropped the duplicate copies the conflict produced. Result: 467 object IDs, all defined exactly once, no dangling references, plutil -lint OK. Sources membership: WatchRecordingStore.swift once each in Runner, RunnerRayBanDat and omiWatchApp; SafeFoundationSinks.swift once each in Runner, RunnerRayBanDat, omiWatchApp and BatteryWidget.
  • backend/utils/sync/pipeline.py: kept both imports (user_selected_recording from this PR, main's input_limits names); both are used.
  • AppDelegate.swift, local_recordings_provider.dart, .github/checks-manifest.yaml and backend/utils/sync/ARCHITECTURE.md auto-merged. Every file except the two resolved conflicts matches git merge-tree of the two parents exactly, and the diff against main is the same 26 files as before the merge.

Re-run on the merge:

  • ruby app/ios/test/watch_recording_recovery_test.rb: 18 runs, 49 assertions, 0 failures under both an unset locale and LANG=en_US.UTF-8. db25f6b makes the harness read sources as UTF-8. Before that, under an unset (US-ASCII) locale, the custody source-scan test raised invalid byte sequence in US-ASCII on the non-ASCII bytes already in AppDelegate.swift.
  • flutter test test/unit/watch_recording_receipt_test.dart test/unit/local_recordings_owner_test.dart test/unit/local_wal_sync_test.dart test/services/wals/: 228 passed. flutter analyze on the touched Dart files: no issues.
  • BACKEND_UNIT_TEST_FILE_LIST=<22 sync/Process Now files> bash backend/test.sh: 984 passed, including test_phone_batch_process_now.py.
  • bash backend/testing/e2e/run.sh testing/e2e/test_watch_recovery_process_now.py: 1 passed.
  • xcodebuild -project Runner.xcodeproj -target omiWatchApp -configuration Debug-dev -sdk watchsimulator CODE_SIGNING_ALLOWED=NO build: BUILD SUCCEEDED.
  • flutter build ios --simulator --debug --flavor dev -d <iPhone 16 Pro sim>: built Runner.app with the Watch companion embedded (Xcode 27.1, Flutter 3.44.5).
  • RayBan DAT flavor: scripts/rayban_dat.sh build ios --simulator --debug -d <sim> fails with Cycle inside RunnerRayBanDat on main 1e1879f itself, the same as on this branch. The cause is main's phase order (Thin Binary before Embed Frameworks); this PR does not change it. The fix is in a separate PR, fix(ios): unblock the Ray-Ban DAT build and keep its project file clean #22596, where the same build succeeds.
  • git diff --check clean; make preflight: 55 checks passed; scripts/pr-preflight --pr-body-file passed.

Code/build/CI checks are complete. Keep this draft for physical paired-device qualification: phone terminated/unavailable, screen off, account change, disk pressure and 11h06m capture with sample/digest, battery and transfer checks. Apple does not deliver WatchConnectivity files in Simulator, so the executable file-custody harness is not a paired transfer test. Then merge, deploy the shared sync-processing image to fresh/backfill workers and inline processing hosts, and release the signed iPhone app with its Watch companion. Historical customer recovery remains unverified.

Product invariants affected

INV-CAP-1, INV-UI-1, INV-UI-3, INV-PERF-1: reuse the existing recordings surface, native Watch controls, async phone receipt reads and bounded audio files. No whole-session memory buffer or automatic duplicate transcription.

UI evidence

Watch pending audio and retry control

Failure class (fixes)

Failure-Class: new

@Git-on-my-level

Copy link
Copy Markdown
Member

Verdict: the custody design here is strong — write-ahead PCM segments, digest-verified receipts, and fail-closed ownership on the iPhone side — and I found no ownership or data-loss hole in the transfer chain. Two follow-ups below before this leaves draft; nothing blocking.

What I verified:

  • app/ios/Runner/WatchRecordingStore.swift — WatchRecordingInbox.receive validates framing and digest, publishes the owner sidecar before the discoverable .bin, and keeps receipts after deletion so a Watch retry cannot resurrect audio the user removed; pruneAcknowledged deletes only on digest match. Recovery of torn .part files preserves conflicting originals instead of overwriting.
  • app/ios/omiWatchApp/WatchAudioRecorderViewModel.swift — audio callbacks carry the archive session token (stale callbacks from a previous recording are rejected in append), the capture watchdog retires the indicator if frames stop, and the transfer queue retries only current-account files with monotonic backoff, capped at 4 in flight.
  • app/lib/services/capture/watch_recording_receipt.dart + local_recordings_provider.dart — the scanner lists a Watch .bin only behind a committed receipt whose reconstructed filename matches; un-receipted files stay invisible rather than adoptable. Correct fail-closed direction, with unit tests for both directions.
  • backend/utils/sync/recording_intent.py — strict fullmatch regex for the Watch marker, single-file only; matches the updated ARCHITECTURE.md.

Follow-ups:

  1. Release coupling: the PR notes both mobile companions must release together and the backend keep rule deploys first, but the intended ship order is only implicit. Until the iPhone side ships, a new Watch build's recovery files are dropped by the released iPhone app (AppDelegate guard returns early). Please state the ship order explicitly (backend → iPhone → Watch?) and how recovery of the original eleven-hour session will be verified on hardware.
  2. app/ios/omiWatchApp/Localizable.xcstrings — the new watch.recovery.* keys ship en+ja only while the app carries more locales; String(localized:) will fall back to the development language, which is likely fine — please confirm that's intended.

Performance: fsync every 1.5s plus a SHA256 over ≤1.94 MB per transferred segment — bounded, and the bounded_writer harness asserts RSS stays under 128 MB across 90 minutes of writes.
Security/privacy: ownerUID travels only over the paired WCSession and is validated before custody transfer; cross-account adoption and unreceipted adoption are both explicitly tested. No raw audio logged.
Blast radius: Watch recording users on iOS; every failure mode in the design retains rather than deletes audio — conservative.

USER IMPACT: Apple Watch recordings now survive Stop and app restarts and keep retrying transfer until the iPhone confirms receipt; users see a pending-transfers count with Retry on the Watch, and recovered audio shows up in Recordings for manual processing.

Still want as a reviewer: the explicit ship-order statement (1), the localization fallback confirmation (2), and a hardware verification plan for the incident session.

Leaving for human maintainer review: the recovery-custody design and dual-companion release sequencing for #20479 need maintainer sign-off before this leaves draft.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@Git-on-my-level Git-on-my-level added needs-maintainer-review Needs a human maintainer to sign off before merge ios labels Oct 17, 2026
@aryanorastar
aryanorastar marked this pull request as ready for review October 18, 2026 02:23
@aryanorastar

Copy link
Copy Markdown
Collaborator Author

Answers to the three follow-ups:

1. Ship order. The Watch app is embedded in the iOS app (omiWatchApp.app in Embed Watch Content, app/ios/Runner.xcodeproj/project.pbxproj), so the iPhone and Watch sides always ship in the same App Store build; they cannot release apart. The order is therefore:

  1. backend first (the recording_intent.py keep rule);
  2. then one iOS release carrying both companions.

The released-iPhone-drops-new-Watch-files case only arises in local mixed installs, not in store builds.

2. Localization. Intended and consistent. The Watch catalog's source language is en, and every key in it, the existing four and the new seven watch.recovery.* keys, carries exactly en + ja. The new keys match the Watch app's current coverage, and other locales fall back to English exactly as the existing Watch strings do today.

3. Hardware verification. Planned on a paired Watch with a TestFlight build:

  • record about 20 min with the iPhone app force-quit, then about 20 min with the iPhone out of range;
  • confirm the Watch shows pending transfers;
  • reopen the iPhone and confirm receipts, digest match, Watch-side pruning, and that the recordings appear under Recordings for manual processing;
  • repeat after a Watch app relaunch mid-recording.

The original eleven-hour session cannot be recovered by this change. Before it, the Watch kept no original file, so whatever survives of that session exists only server-side, and that needs a prod check rather than this build.

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

aryanorastar: 1412-line/26-file Apple Watch recording-recovery change adding a new durable WatchRecordingStore subsystem; also touches .github/checks-manifest.yaml (known cascade-conflict-prone shared file per memory). Reads as new capability, not a narrow fix, and touches a risky shared file -> approve-only, not merge.

aryanorastar and others added 2 commits October 19, 2026 21:14
…ding-recovery

# Conflicts:
#	app/ios/Runner.xcodeproj/project.pbxproj
#	backend/utils/sync/pipeline.py
Record the post-merge project-membership check and split the release step:
deploy the sync processing backend before the iOS build that contains the
paired iPhone and Watch apps.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@Git-on-my-level Git-on-my-level left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Verdict: the custody design here is correct and well scoped to the Watch recording-loss incident (#20479) - no blocking findings, and I'm noting the maintainer approval on this head.

Correctness notes (file-by-file):

  • app/ios/Runner/WatchRecordingStore.swift: append() writes length-prefixed 320-byte PCM16 frames under one recursive lock with 1.5s fsync cadence, seals at 6,000 frames (one-minute segments bounded at 1.94MB), and recoverInterruptedSegment() rebuilds from the offset-matched .tail journal, preserving torn suffixes for diagnosis. Data-slice compaction (remainder copy) plus autoreleasepool drainage bound memory; the bounded_writer harness scenario asserts RSS stays under 128MB across a simulated 90-minute session.
  • Ownership fails closed at three layers: WatchRecoveryTransferQueue only sends current-account files, WatchRecordingInbox.receive() rejects metadata.ownerUID mismatch against flutter.uid (wrongOwner), and watchRecordingOwner() in app/lib/services/capture/watch_recording_receipt.dart refuses to list any audio_omibatchwatch file without a committed receipt whose reconstructed filename matches exactly. A file published between .bin write and receipt commit is invisible to the scanner rather than adopted - the right direction for cross-account safety.
  • app/ios/Runner/AppDelegate.swift: didReceive file runs WatchRecordingInbox.receive synchronously (correct - WCSession removes file.fileURL on return, and the comment documents it), then returns the receipt via transferUserInfo so the Watch ACK survives backgrounding; on rejection the Watch retains its source and retries.
  • backend/utils/sync/recording_intent.py + pipeline.py: the phone keep-intent predicate is extracted unchanged and extended with a strict fullmatch regex for watch recovery files; mixed/bulk uploads still do not establish a keep choice, and backend/tests/unit/test_phone_batch_process_now.py plus the new e2e test cover both sources. backend/utils/sync/ARCHITECTURE.md matches the code.
  • Watch UI (ContentView.swift, WatchRecorderControlling.swift, omiwatchApp.swift): pending-transfer badge, retry on scene activation, localized error strings, and a capture-health watchdog that retires the recording indicator when frames stop arriving.

Performance: the 60s retry cycle SHA256-digests pending one-minute segments (max 4 in flight) - negligible. UX: recovered recordings appear in Recordings and keep the explicit Process Now keep behavior instead of being auto-discarded. Blast radius if wrong: Watch recovery copies only; live transcription is untouched, and every failure mode retains or quarantines audio rather than exposing it cross-account.

USER IMPACT: Apple Watch recordings now survive Stop, app restarts, and failed transfers - the Watch keeps a recovery copy until the iPhone confirms receipt, and recovered audio shows up in Recordings instead of being silently dropped.

Still wanted (non-blocking): backfill this PR into the empty evidence_prs of .github/failure-classes/FC-watch-audio-released-before-durable-receipt.json after merge, and a physical-device spot-check of the documented 1.5s power-loss window would strengthen the custody claim.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@Git-on-my-level Git-on-my-level added positive-signal Automation verified a genuine fix/quality contribution and removed needs-maintainer-review Needs a human maintainer to sign off before merge labels Oct 19, 2026
@aryanorastar

Copy link
Copy Markdown
Collaborator Author

Pushed 4848528 (from ca035fc): merged current origin/main and ordered the rollout checklist.

  • project.pbxproj conflict resolved by hand: kept main's entries (SafeFoundationSinks ref/build files, SiriSession) and this PR's WatchRecordingStore ref and build files, and dropped the duplicates. 467 IDs, each defined once, no dangling refs, plutil -lint OK. WatchRecordingStore compiles once each into Runner, RunnerRayBanDat and omiWatchApp; SafeFoundationSinks has one entry per target.
  • backend/utils/sync/pipeline.py: kept both imports. Every other file matches git merge-tree of the two parents, and the diff vs main is the same 26 files as before.
  • app/docs/apple-watch-recovery.md: the checklist now says to deploy the sync processing backend before the iOS release that contains the paired iPhone/Watch apps.

Re-run on the merge: watch recovery harness 18 runs / 49 assertions (UTF-8 locale); Flutter receipt/ownership/WAL 228 passed; backend sync and Process Now 984 passed; hermetic Watch Process Now e2e 1 passed; Watch target and Debug-dev iPhone simulator builds succeeded; make preflight 55 checks passed.

Open: the RayBan simulator build fails locally with Cycle inside RunnerRayBanDat (OnDeviceParakeet embed vs Thin Binary). That target's build phases are identical to main and this PR only adds a Sources entry; not yet confirmed on main itself. Physical paired-device qualification is still pending, and the incident stays open.

…ocale

AppDelegate.swift contains non-ASCII bytes, so under an unset locale Ruby
defaults to US-ASCII and the custody source-scan test raised
"invalid byte sequence in US-ASCII" instead of asserting.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@aryanorastar

Copy link
Copy Markdown
Collaborator Author

Pushed db25f6b (from 4848528): the Watch recovery harness now reads sources as UTF-8.

  • app/ios/test/watch_recording_recovery_test.rb sets Encoding.default_external = Encoding::UTF_8. AppDelegate.swift contains non-ASCII bytes, so under an unset shell locale Ruby read it as US-ASCII. The custody source-scan test then raised invalid byte sequence in US-ASCII instead of asserting. Now 18 runs / 49 assertions pass under both an unset locale and LANG=en_US.UTF-8.

RayBan follow-up: the Cycle inside RunnerRayBanDat build failure reproduces on main 1e1879f itself, so this branch didn't cause it. #22596 fixes it on main (phase order), and the same RayBan simulator build passes there.

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 19, 2026

Copy link
Copy Markdown

Auto-fix isn't included in your plan ↗

Upgrade to Team

…ding-recovery

# Conflicts:
#	backend/utils/sync/pipeline.py
@aryanorastar

Copy link
Copy Markdown
Collaborator Author

Pushed 85d0032: merged current main (8edd56d) and resolved the conflict in backend/utils/sync/pipeline.py.

  • Conflict: main added a minimal-redrive branch around _reprocess_merged_conversations (feat(sync): operator minimal redrive mode for preserved legacy audio #22503), and this PR renamed user_selected_phone_recording to selected_recording (from user_selected_recording(), so Watch recordings count as user-selected). The resolution keeps main's redrive_mode branch and passes this PR's selected_recording. No reference to the old name remains.
  • Checks:
    • Backend, each file in its own process: speech redrive 23, phone process-now 13, sync capture pipeline 47, minimal redrive 50, redrive 6, redrive endpoint 2 (141 passed).
    • pyright on pipeline.py with the backend venv: 0 errors.
    • Dart: analyze_ratchet.sh passes, and this PR's Dart tests pass (12).
  • CI's earlier failures: the backend shards and Dart ratchet failures came from main at the time (unused_import, stale contract tests); main has since fixed them. The diff against main is exactly this PR's files.

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reconfirming with new evidence: independent technical review (Git-on-my-level, file-by-file) found no blocking issues on the Watch recording-custody design; kodjima33 already approved; CI green; tests extensive. Upgrading from yesterday's approve-only to merge: 4/5 confidence (diff size is the only failing criterion).

@kodjima33
kodjima33 merged commit 544c879 into main Oct 20, 2026
58 checks passed
@kodjima33
kodjima33 deleted the fix/20479-watch-recording-recovery branch October 20, 2026 14:51
aryanorastar added a commit that referenced this pull request Oct 23, 2026
…23280)

## Final merge acceptance — 2026-10-23

Reviewed/tested head `821c326f07846966173b6a66b70c3187094da442`. Fresh
native suites pass **24 tests / 84 assertions**. The production
recorder/view/store probe passes **7 lifecycle cases on the 40 mm Watch
SE 3 simulator / watchOS 27.0**: canceled/late permission, ABA
permission, failed activation, Stop, repeated Stop, denial and missing
owner. Permission/audio-session I/O is injected; `physicalAudio=false`.
Native screenshots confirm visible Stop and separate Retry with pending
transfers, idle Record/Retry, and visible Stop at accessibility3 with a
long recovery error. This is not real microphone, radio transfer or
paired-Watch evidence.

Aryan explicitly accepts simulator-led Omi verification and authorized
merging this PR if ready. This final acceptance supersedes the earlier
physical-device-only merge gates below; physical Watch
connectivity/audio and customer release outcomes remain explicitly
unverified follow-up, not claims of recovery. Required current-head CI
and an existing approval passed before merge. No deployment or store
release is authorized/performed in this task. `Fixes` was changed to
`Refs` so #23275 stays open for release/outcome follow-up rather than
closing on code merge alone.

---

The active Watch screen hides Stop behind the Omi logo, and recorder
teardown leaves AVAudioSession active. This adds a visible **Stop
recording** button, keeps Retry transfer separate, and shares microphone
cleanup across Stop, cancelled permission and failed startup. A delayed
permission answer cannot reactivate a cancelled recording.

Refs #23275. Follow-up to #22059.

Current main already addresses minute-by-minute Home backup clutter
through [#23288](#23288): the
shared custody ledger owns Watch copies, Offline Sync exposes automatic
work, and Home lists explicit user-held recordings. This branch now
integrates that pipeline and removes its superseded Home grouping
proposal. No additional Dart projection, retention rule, backend,
firmware or API change is introduced here. Public store release of
#23288 has not been verified.

### Verification

- Native Watch simulator probe runs the actual production
recorder/view/store with synthetic permission and audio-session I/O: **7
lifecycle cases passed**, including late/ABA permission, activation
failure, Stop, repeated Stop, denial and missing owner. It opens no
microphone.
- Existing custody, relay and presentation suites: **24 tests, 84
assertions passed** after main integration.
- Separate Personal Team-signed QA host on **physical iPhone 16 Pro /
iOS 27.0.1**, compiling unchanged production recorder/view/store: the
final approximately **70-second** capture saved **60.00 + 10.09 seconds
of validated, non-zero PCM**, stopped, successfully deactivated
AVAudioSession with zero errors, and left file sizes unchanged for two
seconds. Final result UTC: **2026-10-23T04:22:27Z**. A direct-phone
spoken test also produced non-zero audio. Aryan manually verified Stop:
the timer stopped and orange microphone indicator disappeared. Earlier
runs with the Mac device view open contained only zero PCM and are not
counted as audible capture evidence; a later start was blocked while the
phone was locked. The final run used the unlocked phone directly with
the device view closed. Retained parts include earlier QA runs, so
totals are attributed by session metadata. The battery adapter is a
no-op; this does not exercise physical watchOS, paired delivery or the
production Omi app/account.

- Native 40 mm Watch simulator renders active Stop + Retry, stopped
Record + Retry, and accessibility3/error state. The stopped-state Retry
clipping and accessibility title wrapping found during inspection are
corrected.
- Current-main analyzer ratchet, local preflight (20 selected checks;
the history-dependent guard explicitly skips on this shallow clone) and
push hooks passed. Full app suite: **7,120 passed, four skipped**, plus
**138 protected contracts passed**. All hermetic mobile journeys passed
(**23 executions, zero failures/skips**). Code Review confirms **iOS
Compile Check, Dart Analyze & Tests, Hygiene and Desktop Swift Static &
Test Contracts passed on `821c326f07846966173b6a66b70c3187094da442`**,
with no failed or running source checks at verification. Scope-skipped
lanes are not claimed as executed.

Reproduce native checks from the repository root:

```sh
ruby app/ios/test/watch_recording_recovery_test.rb
ruby app/ios/test/watch_audio_chunk_relay_test.rb
ruby app/ios/test/watch_recording_presentation_test.rb
ruby app/ios/test/watch_recording_controls_probe.rb --device <booted-watch-simulator-uuid> --output <temporary-directory>
TZ=UTC bash app/test.sh
make mobile-verify ARGS='fast --all'
make preflight
```

The SDK probe needs the CocoaPods Ruby environment (`xcodeproj`).
Private physical-run build/source hashes and result JSON are retained
locally; no microphone audio, device identifier, customer account or
signing credential is published.

### Merge gates and release

**Ready for review; do not merge until paired-Watch acceptance passes:**
press Stop and check microphone indicator with phone
reachable/unavailable, pending transfers and screen-off/resume; capture
across a minute boundary; restart/retry real WatchConnectivity
transfers; verify receipt-owned originals, playback and processing on
iPhone; confirm Home has no automatic minute-copy rows and originals
remain accessible through Offline Sync. The iPhone-host result does not
satisfy these Watch gates. Simulator file delivery is unsupported by
[Apple's WatchConnectivity
documentation](https://developer.apple.com/documentation/watchconnectivity/wcsession/transferfile(_:metadata:)).
Longer recovery qualification remains tracked in
`app/docs/apple-watch-recovery.md`.

Source checks have passed on the exact pushed head. Complete
paired-hardware acceptance and compare against David's concurrent work
before readiness; refresh affected checks if changes follow that review.
No review of unpublished changes is claimed. After acceptance, this
needs merge and a signed iPhone release containing the updated Watch
companion. This follow-up adds no backend deployment; #22059's existing
processing-backend rollout dependency remains separately tracked. No
deployment, app-store release or older-audio recovery is claimed.

### Product invariants

INV-CAP-1: preserve original recovery files, session fencing, durable
receipts and account ownership; microphone teardown does not change
custody.
INV-UI-1 / INV-UI-3: reuse native controls and existing localized Stop
labels, preserve explicit controls with pending/error state and large
text.
INV-PERF-1: no new per-frame UI work, scan, timer or uploader; main's
canonical custody pipeline remains authoritative.

### Failure class

Failure-Class: new

Root cause: recorder cleanup stopped the engine without releasing
AVAudioSession; permission checking also activated audio before
validating the original start generation. Trigger: #23275; these
lifecycle defects predate #22059, while that PR introduced the
minute-copy clutter now handled by #23288.

Prevention uses a shared `releaseCaptureResources` primitive for Stop
and failed startup, plus generation validation before session
activation. The durable guard is
`app/ios/test/watch_recording_controls_probe.rb` with
`app/ios/test/fixtures/watch_recording_controls_app.swift`, executing
the production model with synthetic OS I/O. It is an explicit
SDK/simulator lane, not a default hermetic CI or physical Watch
qualification.

### UI evidence

UI-Evidence:
.agent-artifacts/ui-evidence/watch-session-controls/evidence.json

Actual native views with synthetic state; no physical microphone or
transfer claim.

![40 mm Watch Stop and
Retry](https://raw.githubusercontent.com/BasedHardware/omi/15635a4a3bae5e94524d06994e845bf423126d4b/.agent-artifacts/ui-evidence/watch-session-controls/001-mobile-ios-watch-stop.png)
![Stopped Watch with Retry
visible](https://raw.githubusercontent.com/BasedHardware/omi/15635a4a3bae5e94524d06994e845bf423126d4b/.agent-artifacts/ui-evidence/watch-session-controls/005-mobile-ios-watch-idle-pending.png)
![Accessibility text and error
state](https://raw.githubusercontent.com/BasedHardware/omi/15635a4a3bae5e94524d06994e845bf423126d4b/.agent-artifacts/ui-evidence/watch-session-controls/006-mobile-ios-watch-accessibility-stop.png)


## 2026-10-23 maintainer review and merge gates

Reviewed the current production Stop/cleanup/generation changes and
reran the native recovery, relay and presentation suites: 24 tests / 84
assertions pass. No new blocking source finding in this bounded review.
Existing iPhone-host microphone evidence is not a paired-Watch test.
Ready for code review at Aryan's request; merge stays blocked until real
Watch Stop/microphone release, minute-boundary capture,
reachable/unreachable phone transfer retry, screen-off/resume, retained
originals/playback/processing and Home/Offline Sync behavior are
verified. No physical device was accessed in this review and no
deployment/release was performed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ios positive-signal Automation verified a genuine fix/quality contribution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants