Skip to content

fix(app): support storage-authoritative CV1 capture - #10656

Closed
axAilotl wants to merge 44 commits into
BasedHardware:mainfrom
axAilotl:codex/cv1-storage-first-app
Closed

axAilotl wants to merge 44 commits into
BasedHardware:mainfrom
axAilotl:codex/cv1-storage-first-app

Conversation

@axAilotl

@axAilotl axAilotl commented Jul 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Companion-app support for the storage-authoritative CV1 3.0.29 firmware in #10654.

The operating contract is now explicit and shared by Android and iOS:

  • normal connected operation is live capture;
  • the app may automatically repair a gap inside the still-open conversation;
  • historical pendant backlog drains only after a Sync tap or the existing Auto Sync opt-in;
  • charging is capacity, not transfer authority, and never starts a deep drain;
  • if transcription is unavailable, durable audio remains on the pendant instead of becoming an unbounded phone-side queue.

Physical five-minute archives and bounded ring reads are transport boundaries, not conversation boundaries. The app assembles adjacent, provably ordered ranges within the configured silence window into one logical recording and one upload job.

The proposed INV-CAPTURE-1 contract now records this end-to-end behavior in the repository: pendant storage → shared companion policy → live preview → idempotent upload → backend conversation projection. Native Android/iOS code owns transport mechanics, not conversation boundaries.

This remains a team-test draft. It is not ready for public beta promotion.

Root cause

Live notifications, recent-gap repair, historical sync, BLE restoration, and WebSocket recovery previously had overlapping authority.

That allowed several regressions:

  1. reconnect work could compete with the current live cursor;
  2. bounded device reads could surface as hundreds of tiny phone recordings;
  3. historical backlog could drain merely because the pendant was charging;
  4. a storage-authoritative tail could keep consuming data while no transcription session was ready;
  5. iOS CoreBluetooth restoration could retain the one-connection pendant in a background-launched process and prevent Android from acquiring it;
  6. the physical-test runbooks independently encoded backend identity, and both preflights certified api.omiapi.com as production even though that live socket closed before readiness.

The charging behavior entered this feature stack in 47be02d84c; it was not a pre-existing product invariant. This PR removes it from the authority boundary.

What changed

Durable storage and conversation assembly

  • append every complete bounded ring read before ADVANCE;
  • retain device/range identity, capture timestamps, sequence coverage, and upload intent across restart;
  • keep live audio and active-conversation gaps ahead of old history;
  • latch one immutable write-sequence target per manual Sync request;
  • make the deep-backlog policy required and fail closed;
  • group adjacent physical archives using the configured conversation boundary;
  • compact only overlaps whose exact sequence union is provable;
  • preserve one canonical recording/upload owner while keeping physical members for acknowledgement and retry;
  • materialize that logical recording on demand when the user opens it, so grouped rows remain playable without exposing physical fragments;
  • pace complete Opus batches without truncating them under socket congestion;
  • preserve preview segments, conversation identity, and timing ownership across retryable reconnects.

Explicit live/backlog authority

  • Auto Sync is the only automatic deep-backlog authority;
  • one Sync tap authorizes one bounded snapshot;
  • authorized history runs in bounded slices, and newly arrived live audio preempts the next historical slice;
  • charging no longer changes sync authority;
  • recent gap repair remains enabled when Auto Sync is off;
  • storage-authoritative audio waits on explicit STT readiness;
  • socket close/error cancels the phone-side live tail while the pendant keeps recording;
  • socket close/error is shown as Reconnecting transcription, never as a false Listening state;
  • Transcribe Later remains an intentional local-capture exception.

The policy lives in shared Dart code, so Android and iOS cannot silently choose different live/backlog behavior.

BLE ownership

  • serialize Android GATT work and bind completions to the active connection session;
  • serialize iOS notification ownership and republish readiness for an already-connected restored peripheral;
  • reclaim the exact pendant after DFU;
  • when iOS Background Mode is disabled, release the exact OS-restored peripheral and defer reconnect until real foreground activation;
  • when Background Mode is enabled, preserve CoreBluetooth restoration as the user's explicit opt-in.

Diagnostics and developer fixtures

  • serialize debug-log initialization, rotation, append, clear, and pruning;
  • redact WebSocket query values;
  • source Android/iOS physical-test identity from one executable customer-plane contract;
  • reject any authenticated hardware build whose generated environment is not https://api.omi.me/, even when Firebase auth would succeed;
  • document the exact maintainer toolchain, isolated iOS bundle, and physical acceptance matrix.

Regression coverage

The tests pin these contracts:

  • Auto Sync off still recovers the recent conversation window but never starts the deep prefix;
  • charging cannot authorize a deep drain;
  • manual Sync owns one immutable snapshot while live capture stays prioritized;
  • audio arriving during a backlog slice is fetched before any subsequent historical slice;
  • a repeated Sync tap shares the in-flight request;
  • cancellation revokes only the manual historical authority, not live capture;
  • a snapshot survives same-device reconnect without expanding and is never adopted by another pendant;
  • storage-authoritative capture does not consume device audio before STT is ready;
  • abnormal live-socket close/error renders a retryable reconnect state and server readiness clears it;
  • a grouped logical Sync row materializes one ordered, memoized, playable artifact;
  • legacy BLE and Transcribe Later retain their intended behavior;
  • iOS restoration releases without Background Mode, preserves an opted-in restoration, and does not treat .inactive launch state as foreground;
  • Android/iOS transport handoff, DFU, session-bound GATT, sequence, assembly, dedupe, upload, and preview contracts remain covered by the existing focused suites.

Physical Android evidence

Authenticated dev build, exact paired CV1 on 3.0.29, Auto Sync off:

  • the installed isolated dev package was regenerated and verified against https://api.omi.me/ plus the production Firebase account universe; the canonical live socket reached ready in about 0.72 seconds;
  • a spoken marker produced live-preview segments before disruption;
  • Bluetooth off/on reconnected the exact pendant without force-stop or app restart;
  • live preview resumed about 3.7 seconds after BLE reconnected and continued in the existing socket/conversation session;
  • firmware dropped remained 0 in the completed recovery runs;
  • the reconnect replay registered the overlapping first range idempotently, then recovered subsequent sequence ranges in order;
  • the historical read pointer stayed fixed with about 10k packets still pending, proving Auto Sync off did not drain or advance old backlog;
  • no local-file upload or historical-sync request ran during the live/reconnect test;
  • hundreds of physical bounded ranges assembled into one logical conversation rather than independent one-second uploads;

The previous no-preview result was invalid hardware evidence: the dev APK targeted api.omiapi.com, whose WebSocket upgraded and then closed with code 1006 before its first service event. The same authenticated probe against api.omi.me reached initiating → conversation_session → ready; the corrected build then passed the physical live/reconnect path above.

Redacted evidence: app/e2e/ANDROID_CV1_STORAGE_FIRST_RUN_2026-07-28.md.

Physical iOS evidence

Authenticated signed isolated dev build; the production app was not replaced:

  • process-loss recovery reclaimed the exact pendant and recovered one contiguous pre/offline/post-reconnect source window;
  • local and server inspection preserved the offline markers in order;
  • an already-connected CoreBluetooth peripheral now republishes GATT readiness instead of leaving the UI connected but capture inert;
  • two initial cross-host handoff policy variants failed and are recorded as failures;
  • system logs proved bluetoothd/SpringBoard were restoring the physical link before Flutter foreground policy ran;
  • the current candidate retrieves and cancels that exact restored peripheral when Background Mode is off.

The final four-leg iOS → restored-background-iOS → Android → foreground-iOS handoff remains unclaimed until the plugged-in iPhone is unlocked and all four legs pass.

Redacted evidence: app/e2e/IOS_CV1_STORAGE_FIRST_RUN_2026-07-29.md.

Verification

  • full app suite: 1,178 tests passed;
  • final rebased focused BLE/storage suite: 93 tests passed;
  • post-clarification ring scheduler suite: 51/51 tests passed, including live arrival during an active manual drain;
  • current focused capture/storage/DFU suite after the endpoint and playback fixes: 264 tests passed;
  • conversation-session and reconnect-preview contracts: 6 tests passed;
  • Android and iOS physical-auth mutation suites: passed; both reject api.omiapi.com and consume the same executable authority;
  • analyzer ratchet: passed;
  • iOS native BLE ownership suites: passed after the final rebase;
  • Android authenticated assembleDevDebug: passed and installed in place;
  • iOS authenticated profile build: passed, signed, installed in an isolated bundle, and retained auth/pairing;
  • bounded pre-push gate passed with the documented shared-preflight hatch; mandatory failure-class guard, backend checks, generated-output checks, format checks, and desktop Swift debug compile all passed;
  • git diff --check: passed;
  • branch rebased onto current BasedHardware/omi:main;
  • locked product invariants matched by path: none; proposed INV-CAPTURE-1 is introduced and cited;
  • failure-class validation: FC-split-mutation-authority.

The full local make preflight currently stops at the repository-wide agents-md-lean check because web/admin/AGENTS.md is 1,812 bytes against a 1,500-byte baseline. The file is byte-identical to current upstream main and is not part of this PR. All selected checks before that upstream-main blocker passed. This draft does not claim a green full preflight.

Known limits before promotion

  • final physical cross-host iOS handoff is pending the device unlock;
  • Android grouped-recording playback has hermetic behavioral coverage but its final physical tap/play check is pending the phone PIN unlock;
  • the active reconnect marker session was not finalized into the conversation-list API, so exact marker text identity remains unclaimed even though preview and sequence-recovery logs passed;
  • /v2/sync-local-files still does not consume the app's canonical transcript replacement request, so recovered content can be correct while the final conversation duration/origin remains wrong;
  • Remote VAD gates the live listener but does not yet gate offline sync-file uploads;
  • a manual snapshot receipt is process-memory-only; process death loses authorization, not audio, and requires another Sync tap;
  • full-day battery/thermal qualification and the bounded manual large-backlog interruption run remain pending.

Depends on firmware draft #10654.

Product invariants affected

INV-CAPTURE-1 (proposed): establishes the single durable conversation timeline, live-priority scheduling, explicit historical-sync authority, truthful live state, and cross-platform policy boundary. No locked invariant path is matched by this diff.

Failure class

Failure-Class: FC-split-mutation-authority


2026-08-05 Fast Sync qualification update

Commit 34750cf763 closes the remaining app-side fixed-snapshot drain failures
found during the physical iPhone run.

Behavior now pinned

  • One explicit Fast Sync tap latches one immutable ring write-sequence
    target. Audio recorded afterward stays outside that target, so the drain can
    finish even while the pendant continues recording.
  • Fast Sync exclusively owns BLE while that snapshot drains. Live preview is
    intentionally paused, then resumes immediately after completion,
    cancellation, or a recoverable transfer failure.
  • Every bounded range is durably accepted on the phone before ADVANCE.
    Ambiguous recovered ranges remain durable and unowned instead of aborting
    the acknowledgement transaction.
  • Same-device reconnect adopts the in-flight target; another pendant cannot.
  • Local recovery orders sequence-addressed ranges by immutable ring sequence
    before wall-clock time, preventing RTC discontinuities from manufacturing
    long transcript gaps.
  • The Sync page now shows determinate progress against the immutable target.
    Device used/free bytes remain an honest cached status sample rather than a
    synthetic transfer counter, because newer audio may continue entering the
    ring during the drain.

Physical iOS result

Fixture: isolated authenticated dev bundle, exact pendant
425529A3-6F68-F264-C0CA-DAC438DA1240, internal firmware 3.0.30 build 110,
with OMI_BLACKBOX_HARNESS=true asserted at runtime.

  • Cold launch reached automatic live preview without opening the listening
    card.
  • The clean fixed-snapshot pass stayed in the download phase at +2, +18, and
    +60 seconds while the target drained.
  • Device storage fell from 119 MB / 25% to 110 MB / 23%. The tester correctly
    identified that the byte card was stale until navigation; the new
    determinate target-progress UI addresses that observability defect without
    falsifying the cached byte sample.
  • Cancellation returned the app to idle in under two seconds.
  • Returning home showed Listening immediately, and a long spoken marker
    appeared automatically without tapping the card.
  • A follow-up signed build preserved auth and pairing. Its already-covered
    target advanced to cloud upload in under nine seconds, so the intermediate
    percentage is regression-test pinned rather than claimed as a long physical
    observation.

Permanent redacted evidence, screenshots, hashes, and excluded invalid runs
are in:
~/Omi-CV1-Reliability-Work/evidence/fast-sync-ios-2026-08-05/REPORT.md.

Verification

  • app/test.sh: 1,260 tests passed.
  • app/scripts/analyze_ratchet.sh: passed.
  • git diff --check: passed.
  • Failure-class validation: passed; the PR declaration remains
    FC-split-mutation-authority.
  • Repository-wide local preflight passed all selected lanes through
    product-file-line-count-ratchet, then stopped at the existing
    agents-md-lean debt: backend/AGENTS.md is 39,089 bytes against a
    39,000-byte budget. That file is outside this app commit. This update does
    not claim a green full preflight.
  • The bounded pre-push rerun passed the mandatory failure-class ratchet,
    backend type/unit checks, runtime-image closure, OpenAPI compatibility,
    generated Flutter output, and desktop-flow metadata. Its unrelated desktop
    Swift lane then hit a local SwiftPM cache miss for FluidAudio commit
    19600a485baa4998812e4654b70d2bab8f2c9949; the documented app-only hatch was
    used rather than changing desktop dependency state in this PR.

Promotion boundary

This remains a team-test draft. Voice gating is intentionally out of scope.
Public promotion still needs matched Android qualification, post-drain
duplicate/order/conversation-binding inspection, process-death ownership
coverage, and battery/thermal measurements.

Standalone iOS dogfood handoff correction

The v5 physical session was valid while Flutter tooling was attached, but the
phone was incorrectly handed back with that debug/JIT artifact still
installed. It crashed after approximately 23 minutes and two SpringBoard
relaunches then failed in native notification-plugin registration before Dart
started. This was a build-mode/handoff failure, not a Fast Sync protocol
failure.

The branch now contains a reproducible physical-config bootstrap, signed iOS
profile builder, and guarded in-place dogfood installer. The installer refuses
Flutter artifacts containing kernel_blob.bin, verifies the exact Firebase,
bundle, signature, and application identifiers, preserves the app data
container, and proves a cold launch. The former v5 debug artifact was
physically rejected by the guard; signed v6 profile/AOT was installed over the
same bundle and remained running after cold launch, with no new Runner crash
report. The final unattended handoff rule and crash signature are documented
in app/e2e/BLE_RELIABILITY_ACCEPTANCE.md and the permanent evidence report.

The handoff boundary is now registered in .github/checks-manifest.yaml for
both Linux and macOS. Its hermetic core/error-path test accepts a signed AOT
fixture and rejects a JIT kernel_blob.bin fixture before any device command
can run. The same guard physically rejected the former v5 debug artifact and
accepted the signed v6 profile artifact. Personal team, signing, provisioning,
and device identities remain only in
~/.config/omi-mobile-test/ios-physical-test.env, never in the public branch.


2026-08-05 post-drain playback and upload correction

The completed physical Fast Sync drained the pendant from roughly 20% used to
1% used and transferred the fixed snapshot to the iPhone. Inspection then
separated failures that initially looked like corrupt recovered audio:

  1. The recovered archive is valid mono PCM at 16 kHz. Offline transcription of
    the exact cached WAV recovered spoken test markers, so the pendant capture,
    BLE transfer, and logical materialization did not produce an empty file.
  2. iOS playback started without first activating the shared speech audio
    session, which could yield a moving waveform with inaudible output after
    route changes. Playback now configures and activates the session before the
    player advances and releases only the session it owns.
  3. One immutable logical upload was 66,663,240 bytes and received HTTP 413.
    That deterministic rejection blocked every later healthy recording behind
    it. HTTP 413 is now typed at the API boundary; automatic sync retains the
    rejected source and marks it exhausted while continuing with later jobs.
    Explicit row retry remains available.
  4. Some recovered rows carried an RTC-derived capture end earlier than the
    duration proved by their encoded frames. Recovery now preserves immutable
    pendant sequence while publishing a canonical end no earlier than playable
    audio duration. This fixes misleading sparse 30–60 minute rows without
    splitting a sequence-contiguous archive at a wall-clock correction.

An app-only split of the 66.7 MB logical recording into independent cloud jobs
would violate conversation ownership and can create duplicate summaries. Full
cloud acceptance of recordings above the current request limit needs a
separate backend resumable/chunked-upload contract with one idempotent logical
recording identity. Until then the rejected source remains recoverable on the
phone and no longer stalls the queue.

Regression coverage and evidence

  • focused recovered-playback, WAL recovery, assembler, sync-provider, and
    upload-resilience suites: 139 tests passed;
  • full Flutter app suite after these corrections: 1,266 tests passed;
  • analyzer ratchet and git diff --check: passed;
  • signed profile/AOT v7 build: codesign verified, guarded in-place install,
    auth/pairing preserved, and cold launch passed;
  • bounded pre-push: mandatory failure-class ratchet, backend type/unit checks,
    runtime-image closure, OpenAPI compatibility, Flutter generated output,
    desktop-flow metadata, and formatting passed;
  • repository make preflight cannot run its manifest contract under the host's
    system Python 3.9 because current repository syntax requires Python 3.10+;
  • the unrelated desktop Swift compile remains locally uncertified because the
    SwiftPM cache lacks FluidAudio commit
    19600a485baa4998812e4654b70d2bab8f2c9949; the documented app-only hatch was
    used after every in-scope lane passed.

Physical audible playback from the newly installed profile build is the one
remaining user-observed assertion. The exact source audio's integrity is
already proven locally; this draft does not claim the iPhone speaker-route
result until that tap/play check is confirmed.

@Git-on-my-level Git-on-my-level added needs-maintainer-review Needs a human maintainer to sign off before merge needs-tests PR introduces logic that should be covered by tests workflow-review Needs maintainer review for workflow, automation, hooks, or CI behavior labels Jul 26, 2026
@Git-on-my-level

Copy link
Copy Markdown
Member

Thanks for the detailed reliability work here. I’m not approving because this is still a draft, touches BLE/storage/workflow surfaces, and the current head has a blocking CI failure.

Main blocker I found:

  • The new “Run Android native unit tests” step in .github/workflows/mobile-app-checks.yml runs from working-directory: app with ./android/gradlew -p android testDevDebugUnitTest, but this checkout has no app/android/gradlew wrapper. The Android Compile Smoke job is failing with ./android/gradlew: No such file or directory, so the new native test lane is not actually validating the PR yet. Please wire this to an existing Gradle entrypoint or add the wrapper/command the repo expects, then let the Android compile smoke pass.

Agent-behavior/docs note for maintainers:

  • app/AGENTS.md, app/e2e/SKILL.md, and the new BLE reliability acceptance docs now instruct coding/review agents to seed prod-backed dev auth config and run scripts/verify_android_physical_test_auth_config.sh before authenticated Android physical-device BLE evidence. The direction looks safety-oriented and appropriately distinguishes hermetic unit-test config from physical evidence, but it changes how future agents will build and validate BLE runs, so a human maintainer should confirm the procedure and credential assumptions are exactly what Omi wants documented.

The BLE/storage-authoritative implementation is cohesive around one capture/reconnect/backlog reliability surface, and I’m not asking for a split just because it is large. Before this is ready for maintainer merge review, I’d want passing Android native/compile CI plus maintainer confirmation of the physical-device evidence workflow.


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

@axAilotl
axAilotl force-pushed the codex/cv1-storage-first-app branch 3 times, most recently from 875d1ed to 2462adb Compare July 27, 2026 16:17
@Git-on-my-level

Copy link
Copy Markdown
Member

Thanks for the update here. I re-reviewed the current head (c5f40a6) and I’m still not formally approving because the PR is a draft and the change is broad across BLE/GATT ownership, storage/WAL recovery, firmware/DFU handoff, workflows, and agent-facing test docs.

Update since my previous automation comment:

  • The earlier Android native test workflow blocker appears fixed: the mobile workflow now uses gradle -p android testDevDebugUnitTest, and the latest Mobile App Checks run is green.
  • The remaining failing required status I saw is Desktop Swift CI: PTTInputDeviceProbeTests.testMainRunLoopKeepsPumpingWhileTheHALIsWedged reported too few run-loop/turn-start ticks. This PR does not touch the desktop Swift code, so this may be unrelated or flaky, but the status still needs to be green/rerun before merge review.
  • I also ran the new app/scripts/test_verify_android_physical_test_auth_config.sh contract locally in this checkout; it passed.

Agent-behavior/docs maintainer note remains important: app/AGENTS.md, app/e2e/SKILL.md, and the new BLE reliability docs now change how future coding/review agents validate physical Android BLE evidence, including requiring prod-backed dev auth config and the auth-config preflight before installing authenticated hardware builds. The guidance looks safety-oriented and avoids treating hermetic placeholder config as real BLE evidence, but because it documents credential-handling assumptions and becomes agent instruction material, I’d still want a human maintainer to confirm this is the canonical Omi procedure.

Implementation direction looks cohesive around the CV1 storage-authoritative capture/reconnect/backlog reliability surface, and I’m not asking for a split solely due to size. For final review I’d want the PR out of draft, required checks green, and human maintainer confirmation of the physical-device evidence/agent-doc procedure.


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

@axAilotl
axAilotl force-pushed the codex/cv1-storage-first-app branch 3 times, most recently from 59abaf5 to 3bf17fa Compare July 28, 2026 18:36
@undivisible

Copy link
Copy Markdown
Collaborator

Quick maintainer triage (not an approval):

  • Size: ~+18.8k/−1.2k across 113 files — far above “small high-quality” merge bar for a single pass.
  • Mergeability: CONFLICTING with main; needs rebase first.
  • CI: Desktop Swift Static & Test Contracts / Desktop Swift Build & Tests failing (plus dirty base).
  • Blockers before review/approve:
    1. Rebase onto current main and resolve conflicts.
    2. Split or clearly stage (firmware vs app vs platform) if this is a multi-surface CV1 program — 100+ files is hard to audit for storage-authority + capture correctness in one PR.
    3. Get Desktop Swift CI green; call out any intentional contract changes in the PR body.
    4. Security/privacy note for storage-authoritative capture (local retention, wipe paths, multi-user/device isolation) should be explicit in the description.

Leaving unapproved; not merging.

@axAilotl
axAilotl force-pushed the codex/cv1-storage-first-app branch 5 times, most recently from 3809e1b to c08e935 Compare July 30, 2026 17:06
@Git-on-my-level

Copy link
Copy Markdown
Member

Thanks for the continued updates here. I’m still keeping this as human-maintainer review rather than approval: the PR is draft, it touches BLE/GATT ownership, storage/WAL recovery, physical-device evidence, and workflow/test routing, and the current head still has blocking checks.

Current blockers I see on c08e9352:

  • Windows Preflight Portability / Native Windows process and launcher contracts is failing because .github/workflows/windows-preflight-portability.yml calls .github/scripts/run_checks.py with --check-id ..., but the checked-in runner currently does not accept that argument (run_checks.py: error: unrecognized arguments: --check-id ...). Please either add the targeted-check argument support or route this workflow through the runner’s supported selection mechanism.
  • Hygiene / PR Metadata Preflight are failing agents-md-lean because web/admin/AGENTS.md exceeds its size budget. Even if that is inherited from base drift, the PR is not merge-ready while those required checks are red.

Agent-behavior/documentation note: this PR changes app/AGENTS.md, app/e2e/SKILL.md, and the BLE reliability/physical-device evidence docs so future coding/review agents treat hermetic test.sh auth placeholders as invalid for authenticated hardware evidence, seed maintainer-owned production-backed dev auth/Firebase inputs, and require Android/iOS auth-config verifier scripts before installing test builds. That direction looks safety-oriented and the verifier script unit tests pass locally, but it changes canonical agent/test procedure and credential-handling assumptions, so a human maintainer should explicitly sign off before merge.

I’m not asking for a split just because this is large; the change still appears cohesive around the CV1 storage-authoritative capture/reconnect/backlog reliability surface. Before final review, please take it out of draft, get the required checks green, and make sure the physical-device evidence procedure is maintainer-approved.


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

@axAilotl
axAilotl force-pushed the codex/cv1-storage-first-app branch from c08e935 to 84afb47 Compare July 31, 2026 12:51
@Git-on-my-level

Copy link
Copy Markdown
Member

Thanks for the latest head update. I’m still keeping this at human-maintainer review rather than approval: the PR is still draft and it materially changes BLE/GATT ownership, storage/WAL recovery, physical-device evidence procedure, and workflow/test routing.

Current status on 84afb474:

  • The previous Windows preflight blocker appears fixed: Windows Preflight Portability / Native Windows process and launcher contracts is green on this head.
  • Required checks are still red: Hygiene and PR Metadata Preflight are failing desktop-release-process-guards with desktop beta promotion workflow is missing post-qualification guard: github.event.workflow_run.event == 'workflow_dispatch'. Whether that is inherited guard drift or part of this branch’s selected preflight surface, the PR should not move to merge review until the required repo checks are green.
  • The focused physical-test auth verifier contracts still look sane from static review, and I re-ran app/scripts/test_verify_android_physical_test_auth_config.sh plus app/scripts/test_verify_ios_physical_test_auth_config.sh locally; both passed.

Agent-behavior/documentation note remains important: app/AGENTS.md, app/e2e/SKILL.md, and the BLE reliability/physical-device evidence docs change how future coding/review agents validate authenticated hardware evidence. They steer agents away from hermetic test.sh placeholders, toward maintainer-owned production-backed dev Firebase/API inputs, and require Android/iOS auth-config verifier scripts before treating physical-device runs as valid. That direction looks safety-oriented, but it becomes canonical agent/test procedure and touches credential-handling assumptions, so a human maintainer should explicitly sign off before merge.

I’m not asking for a split solely because this is large; it remains cohesive around the CV1 storage-authoritative capture/reconnect/backlog reliability surface. Next merge-review prerequisites are: take it out of draft, get required checks green, and have a maintainer confirm the physical-device evidence/agent-doc procedure.


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

Copy link
Copy Markdown
Member

Coordination / decision record (current state checked 2026-08-01): this remains the open draft for the sole companion-app/native BLE ownership direction. #10654 is the sole firmware/storage-authority direction; this PR depends on the exact protocol/artifact qualified there.

Recommended order: stabilize/rebase #10654; qualify the exact protocol and artifact; merge its code without immediate broad firmware promotion; rebase/retest/merge #10656 against that contract; then release the compatible app before firmware promotion.

Do not add a parallel foreground/visible-transcription PR while these drafts own the moving BLE/WAL/live/backlog lifecycle paths. Evaluate visibility policy only after both land and are qualified. Open a focused policy PR only if measurement shows live-tail/WebSocket activity with no visible transcript surface is materially excessive: proposed trigger P95 >60 seconds/device-day across at least 100 CV1 device-days. Until then, WAIT rather than create a competing transition authority.

Historical/adjacent evidence to reuse without creating another owner:

  • #10572 is the older divergent storage-authority implementation: audit it for unique fixes/tests, transplant those if needed, then supersede it rather than merge competing designs.
  • #10447 and #10431 are adjacent evidence for avoiding redundant raw-audio transports.
  • #10908 is useful Android background BLE lifecycle/resynchronization evidence, not a direct iOS implementation.
  • Merged #7981 establishes native offline/batch capture precedent that should be reused.
  • b8baadae1d is a benchmark/reference for native routing off the Dart hot path, not a blind cherry-pick because it overlaps this PR's ownership changes.

Qualification gates before app release / firmware promotion:

  • Exactly one ring-cursor owner and one audio-notification consumer per device/connection generation; never simultaneous Dart/native consumers.
  • Foreground/background transition is atomic at a durable WAL boundary; stale reconnect/socket callbacks cannot resurrect obsolete live capture.
  • With the socket unavailable, capture remains durable and reconnect/relaunch/Sync/gap repair produce no duplicate source IDs or uploads.
  • Session boundaries remain timestamp/silence authoritative.
  • Full-day battery/thermal runs cover locked/no-visible-transcript, visible live, out-of-range/storage-only, gap repair, historical drain, and near-full-ring stress, with dropped=0 and no corruption or duplicates.

axAilotl commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Build 110 physical iOS qualification (2026-08-04)

Fresh-device test used the exact composite dev IPA with production removed so BLE ownership could not be stolen by a second Omi app.

  • IPA SHA-256: 2ddaf0e3c63a6cf49f0630d9fa5858ca1306056aaa0a58d255f9f5f14b94db8f
  • Cold app launch + pendant power-cycle: the live-preview marker appeared without tapping Listening.
  • Important timing caveat: the photographed +5 s result was measured from the end of the controlled spoken marker to the screenshot, not from app launch, BLE connection, or first syllable. It proves no-touch steady-state delivery, not a five-second cold-start SLO; ambient speech may also have warmed the transcription path.
  • Explicit SD Sync began at 560 recordings / 196 MB used. A second marker appeared by the same +5 s observation point while historical upload was active; live capture continued and storage fell to 195 MB during the controlled interval (the tester later observed 188 MB).
  • No freeze or disconnect was observed during the controlled interval.
  • Focused Flutter suite: 75 tests passed.
  • Post-drain semantic audit (duplicates, ordering, conversation binding) remains required.

The committed runbook/evidence is app/e2e/IOS_CV1_BUILD110_RUN_2026-08-04.md at head 90927b4562.

This physical build was intentionally composite: it includes this PR plus the session-bound iOS GATT stack from #10573. The result must not be read as proof that either PR head alone contains the entire tested binary.

Push note: shared PR preflight, Flutter generated-output checks, and unrelated desktop Swift compilation were explicitly deferred to CI using the repository's documented hatches; focused app/native tests were run locally.

axAilotl commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor Author

iOS standalone dogfood recovery and BLE follow-up (2026-08-04)

The isolated iOS dev app died during a historical backup pull and then crashed on every SpringBoard relaunch. Five device crash reports were preserved before recovery. The final three were identical: EXC_BAD_ACCESS/SIGSEGV in SwiftAwesomeNotificationsPlugin.register(with:) → GeneratedPluginRegistrant → AppDelegate.didFinishLaunching, before Dart, backup enumeration, or restoration ran.

This was the detached Flutter debug/JIT artifact failing to cold-launch without flutter run attached, consistent with the upstream null-registrar debug-launch failure class (flutter/flutter#149214 and flutter/flutter#175088); it is not evidence that backup audio or the app container was corrupt.

Recovery:

  • Reattaching the exact tested debug IPA immediately reached the authenticated Home widget tree.
  • The same composite source was rebuilt as a signed profile/AOT app and installed in place under the same isolated bundle; no uninstall or data clear.
  • Standalone terminate/relaunch succeeded and container state survived.

Corrective BLE note: the first profile process survived but the tester did not see the pendant, so process survival was not accepted as a complete gate. A subsequent instrumented profile relaunch reclaimed exact saved pendant 425529A3-6F68-F264-C0CA-DAC438DA1240 in 1.6 s and enabled battery/audio/diagnostic/transfer notifications by 5.4 s. The export then reported firmware 3.0.30, battery 71%, mobile_ble_error=null, 385,510 audio frames, zero frame drops, zero sync errors, and 152,926,476 sync bytes. The app remains connected as PID 5946.

Disposition: the pendant is connected now, but the initially missed profile UI/device state remains an intermittent cold-start bootstrap finding. Future qualification requires native didConnect, every required subscription, Dart/UI connected state, and live audio—not merely a surviving process.

Full incident and evidence are committed on codex/cv1-blackbox-diagnostics at ffacaf4821. Operationally, debug is only for an actively attached instrumentation session; use the in-place profile build for unattended drain/dogfooding.

@Git-on-my-level

Copy link
Copy Markdown
Member

Thanks for the build-110 iOS qualification and standalone dogfood follow-up. I re-reviewed the current head (90927b45) and am still keeping this in human-maintainer review rather than approval: the PR is draft, has no passing check summary available on the current head, and materially changes BLE/GATT ownership, storage/WAL recovery, workflow/test routing, and agent-facing physical-device evidence docs.

New review note from the latest evidence:

  • The build-110 physical pass is useful, but it is explicitly a composite build that includes this PR plus the session-bound iOS GATT stack from fix(ios): serialize BLE recovery and reclaim CV1 after DFU #10573, so it should not be treated as validation that this PR head alone contains the fully qualified iOS behavior.
  • The standalone dogfood recovery note also leaves an intermittent cold-start/bootstrap finding and says the post-drain semantic audit still remains required. Before final merge review, I’d want that audit recorded for duplicates, ordering, and conversation binding on the exact code stack intended to land, plus the PR out of draft and required checks green.

Agent-behavior/documentation note remains important: app/AGENTS.md, app/e2e/SKILL.md, and the BLE reliability/physical-device evidence docs change how future coding/review agents validate authenticated hardware evidence. They steer agents away from hermetic test.sh placeholders, toward maintainer-owned production-backed dev Firebase/API inputs, and require Android/iOS auth-config verifier scripts before installing authenticated test builds. The verifier contract tests pass locally, and the direction looks safety-oriented, but it becomes canonical agent/test procedure and should be explicitly signed off by a human maintainer.

I’m not asking for a split just because this is large; it is still cohesive around the CV1 storage-authoritative capture/reconnect/backlog reliability surface. The remaining gate is maintainer qualification/sign-off of the exact landing stack and evidence procedure, not PR size alone.


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

Alex Vega added 4 commits August 5, 2026 11:40
Buffer out-of-order flash pages and advance the pendant's cumulative delete watermark only across a contiguous, fsynced prefix.

Failure-Class: none
Validate the full announced record range, flush and register local WALs, and send ADVANCE only after a successful DONE. A partial notification stream or process-visible file write is no longer enough to discard pendant records.

Failure-Class: none
Alex Vega added 9 commits August 5, 2026 11:49
Keep storage-authoritative capture live by default, repair only the open-conversation window automatically, and require Sync or Auto Sync before historical pendant data can drain. Charging is capacity only and cannot authorize transfer. Hold the durable live tail on the pendant while transcription is unavailable.

Verified: 93 focused Flutter reliability tests; full 1,178-test app suite; analyzer ratchet; authenticated Android build and Bluetooth reconnect/no-drain run.

Failure-Class: FC-split-mutation-authority
When CoreBluetooth relaunches the app with Background Mode disabled, release the exact restored peripheral and defer Flutter reconnect requests until a real foreground activation. Preserve restoration only for the existing explicit Background Mode opt-in.

Verified: both native BLE ownership suites pass; signed isolated iOS profile build installs with authentication and pairing preserved. Final cross-host physical handoff remains pending an unlocked iPhone.

Failure-Class: FC-split-mutation-authority
Failure-Class: FC-customer-data-plane-divergence
Make explicit Fast Sync own one fixed ring target, durably preserve recovered ranges before acknowledgement, release BLE on completion/cancel/failure, and return to live capture. Reconstruct recovery sequence-first and expose truthful determinate progress without fabricating device storage bytes.

Verification: app/test.sh (1260 passed); app/scripts/analyze_ratchet.sh; git diff --check; physical iOS fixed-snapshot drain/cancel/live-resume pass documented under ~/Omi-CV1-Reliability-Work/evidence/fast-sync-ios-2026-08-05. Local make preflight passed selected lanes through product-file-line-count-ratchet, then stopped on the out-of-scope backend/AGENTS.md size budget.

Failure-Class: none
@axAilotl
axAilotl force-pushed the codex/cv1-storage-first-app branch from 90927b4 to 34750cf Compare August 5, 2026 17:40
@axAilotl

axAilotl commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

2026-08-05 Fast Sync qualification update

Commit 34750cf763 closes the remaining app-side fixed-snapshot drain failures
found during the physical iPhone run.

Behavior now pinned

  • One explicit Fast Sync tap latches one immutable ring write-sequence
    target. Audio recorded afterward stays outside that target, so the drain can
    finish even while the pendant continues recording.
  • Fast Sync exclusively owns BLE while that snapshot drains. Live preview is
    intentionally paused, then resumes immediately after completion,
    cancellation, or a recoverable transfer failure.
  • Every bounded range is durably accepted on the phone before ADVANCE.
    Ambiguous recovered ranges remain durable and unowned instead of aborting
    the acknowledgement transaction.
  • Same-device reconnect adopts the in-flight target; another pendant cannot.
  • Local recovery orders sequence-addressed ranges by immutable ring sequence
    before wall-clock time, preventing RTC discontinuities from manufacturing
    long transcript gaps.
  • The Sync page now shows determinate progress against the immutable target.
    Device used/free bytes remain an honest cached status sample rather than a
    synthetic transfer counter, because newer audio may continue entering the
    ring during the drain.

Physical iOS result

Fixture: isolated authenticated dev bundle, exact pendant
425529A3-6F68-F264-C0CA-DAC438DA1240, internal firmware 3.0.30 build 110,
with OMI_BLACKBOX_HARNESS=true asserted at runtime.

  • Cold launch reached automatic live preview without opening the listening
    card.
  • The clean fixed-snapshot pass stayed in the download phase at +2, +18, and
    +60 seconds while the target drained.
  • Device storage fell from 119 MB / 25% to 110 MB / 23%. The tester correctly
    identified that the byte card was stale until navigation; the new
    determinate target-progress UI addresses that observability defect without
    falsifying the cached byte sample.
  • Cancellation returned the app to idle in under two seconds.
  • Returning home showed Listening immediately, and a long spoken marker
    appeared automatically without tapping the card.
  • A follow-up signed build preserved auth and pairing. Its already-covered
    target advanced to cloud upload in under nine seconds, so the intermediate
    percentage is regression-test pinned rather than claimed as a long physical
    observation.

Permanent redacted evidence, screenshots, hashes, and excluded invalid runs
are in:
~/Omi-CV1-Reliability-Work/evidence/fast-sync-ios-2026-08-05/REPORT.md.

Verification

  • app/test.sh: 1,260 tests passed.
  • app/scripts/analyze_ratchet.sh: passed.
  • git diff --check: passed.
  • Failure-class validation: passed; the PR declaration remains
    FC-split-mutation-authority.
  • Repository-wide local preflight passed all selected lanes through
    product-file-line-count-ratchet, then stopped at the existing
    agents-md-lean debt: backend/AGENTS.md is 39,089 bytes against a
    39,000-byte budget. That file is outside this app commit. This update does
    not claim a green full preflight.
  • The bounded pre-push rerun passed the mandatory failure-class ratchet,
    backend type/unit checks, runtime-image closure, OpenAPI compatibility,
    generated Flutter output, and desktop-flow metadata. Its unrelated desktop
    Swift lane then hit a local SwiftPM cache miss for FluidAudio commit
    19600a485baa4998812e4654b70d2bab8f2c9949; the documented app-only hatch was
    used rather than changing desktop dependency state in this PR.

Promotion boundary

This remains a team-test draft. Voice gating is intentionally out of scope.
Public promotion still needs matched Android qualification, post-drain
duplicate/order/conversation-binding inspection, process-death ownership
coverage, and battery/thermal measurements.

Alex Vega added 5 commits August 5, 2026 14:07
Fail closed when a physical iOS handoff artifact contains Flutter's debug JIT kernel, keep personal signing and device identities in ignored maintainer config, and install the signed profile build in place so auth and durable sync state survive.

Verification: ios-dogfood-artifact-mode manifest check (2 passed); Android/iOS physical auth manifest checks passed; bash -n and shellcheck passed; profile build completed and codesign verified; former v5 JIT app rejected before device mutation; v6 profile app installed in place, cold-launched, and remained alive with no new Runner crash report.

Failure-Class: none
Configure and activate the shared speech playback session before advancing FlutterSoundPlayer, and release only the session this player owns on stop, completion, or failure.

Verification: flutter test test/unit/audio_player_utils_test.dart; full Flutter app suite (1266 passed); app/scripts/analyze_ratchet.sh; signed profile/AOT build, codesign verification, guarded in-place install, and cold launch on the physical iPhone.

Failure-Class: new
Classify HTTP 413 at the sync boundary, retain the immutable source batch, stop deterministic automatic retry churn, and keep later healthy recordings moving through the same drain. Explicit row retry remains available.

Verification: flutter test test/unit/wal_upload_resilience_test.dart test/unit/local_wal_sync_test.dart; full Flutter app suite (1266 passed); app/scripts/analyze_ratchet.sh.

Failure-Class: new
Reject persisted capture ends that precede encoded payload duration, publish canonical ends no earlier than playable audio, and order logical playback by immutable pendant sequence across RTC corrections.

Verification: flutter test test/unit/wal_recovery_test.dart test/unit/conversation_audio_assembler_test.dart test/unit/local_wal_sync_test.dart test/providers/sync_provider_sync_wal_wake_test.dart; full Flutter app suite (1266 passed); app/scripts/analyze_ratchet.sh.

Failure-Class: new
Document the physical recovered-playback route check and the non-destructive 413 queue contract, including why an app-only split into independent cloud jobs is unsafe.
@Git-on-my-level Git-on-my-level added the flutter flutter work label Aug 6, 2026
@Git-on-my-level

Copy link
Copy Markdown
Member

Thanks for the continued qualification work here. I re-reviewed the current head (c5cf5ed) and I’m keeping this as human-maintainer review rather than approval.

What looks positive:

  • The storage-authoritative direction is coherent: live capture remains the default, explicit Fast Sync/manual authority is separated from automatic backlog drain, and the PR adds substantial regression coverage around WAL ordering, upload resilience, BLE ownership, and playback/session behavior.
  • The new physical-test auth guards are a good safety improvement: the docs and scripts now reject placeholder/hermetic config and the wrong API/Firebase combinations before maintainers treat physical-device evidence as valid.

Current merge-review blockers:

  • The PR is still a draft and the current required checks are not green (PR Metadata Preflight and Hygiene are failing on this head).
  • The PR still changes sensitive BLE/GATT ownership, durable audio/WAL recovery, upload failure handling, physical-device runbooks, and workflow/test routing in one broad companion-app draft, so it needs human maintainer/product review before merge.
  • The latest PR text still leaves at least one user-observed assertion unclaimed: physical audible playback from the newly installed profile build remains pending, even though the exact recovered source audio integrity is covered locally. Please keep that boundary explicit and record the exact-head result before promotion/merge review.

Agent-behavior / maintainer-doc note:

  • app/AGENTS.md, app/e2e/SKILL.md, app/e2e/BLE_RELIABILITY_ACCEPTANCE.md, and the related physical-run evidence docs now guide coding/review agents and maintainers toward production-backed isolated dev physical testing, explicit config verification, and rejecting invalid api.omiapi.com/placeholder Firebase evidence. That guidance looks directionally safe because it emphasizes local ignored credentials, redaction, and preflight guards, but it materially changes how agents may build and qualify BLE/storage work in this repo. Human maintainer review should confirm the runbook is accurate and that no agent is encouraged to run hardware tests with committed or shared secrets.

I added the flutter category label because the primary implementation surface is the Flutter companion app capture/storage/sync flow, even though the PR also touches Android/iOS native BLE and workflow docs. Existing needs-tests, needs-maintainer-review, and workflow-review labels still apply.


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

@undivisible undivisible added human Human-authored pull request app mobile docs-tooling Layer: Documentation, examples, dev tools dependency-review Touches dependencies or lockfiles; needs dependency review security-review Touches auth, provider routing, secrets, or security-sensitive surfaces privacy-review Touches user-data persistence, permissions, or privacy-sensitive surfaces labels Aug 10, 2026
@Git-on-my-level Git-on-my-level removed docs-tooling Layer: Documentation, examples, dev tools dependency-review Touches dependencies or lockfiles; needs dependency review labels Aug 11, 2026
@axAilotl

Copy link
Copy Markdown
Contributor Author

Closing this experimental CV1/storage-first branch. The only firmware reliability change being carried forward is #11578; this PR is not part of that release candidate.

@axAilotl axAilotl closed this Aug 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Hey @axAilotl 👋

Thank you so much for taking the time to contribute to Omi! We truly appreciate you putting in the effort to submit this pull request.

After careful review, we've decided not to merge this particular PR. Please don't take this personally — we genuinely try to merge as many contributions as possible, but sometimes we have to make tough calls based on:

  • Project standards — Ensuring consistency across the codebase
  • User needs — Making sure changes align with what our users need
  • Code best practices — Maintaining code quality and maintainability
  • Project direction — Keeping aligned with our product principles and locked invariants

Before your next PR, please skim:

  • PRODUCT.md — product north star
  • Product invariants — locked rules (shared chat, memory tiers, agent control plane, integrations, brand)

If this was declined for direction or taste, maintainers should cite an invariant ID or open a proposed one — ask if that citation is missing.

Your contribution is still valuable to us, and we'd love to see you contribute again in the future! If you'd like feedback on how to improve this PR or want to discuss alternative approaches, please don't hesitate to reach out.

Thank you for being part of the Omi community!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app flutter flutter work human Human-authored pull request mobile needs-maintainer-review Needs a human maintainer to sign off before merge needs-tests PR introduces logic that should be covered by tests privacy-review Touches user-data persistence, permissions, or privacy-sensitive surfaces security-review Touches auth, provider routing, secrets, or security-sensitive surfaces workflow-review Needs maintainer review for workflow, automation, hooks, or CI behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants