Repository navigation
SCA-4372: measure mobile upload-to-transcript latency by hold state - #26318
Merged
Merged
Conversation
…d-hold-metric # Conflicts: # backend/deploy/cloud_run_gmp_sync.yaml
Git-on-my-level
added a commit
that referenced
this pull request
Nov 27, 2026
…d hold (#26519) ## Summary Resolves the accepted review follow-ups for #26319 and #26318 under SCA-4372. Rollout stays at 0%. Release owns the serving canary and the decision to ramp. The handset changes are confined to the existing hold and WAL drain. The backend reads the gate from the existing request trace in memory and adds it to the phone-age histogram. The existing intake, coalescing and publication writes carry the same metadata. Additional Firestore reads and writes per upload are both zero. Rollback is a revert of this PR with the hold flag kept at 0%. ## Accepted findings | Review | Disposition | | --- | --- | | #26319 F1 | Already resolved. [Main receives the hold and age headers](https://github.com/BasedHardware/omi/blob/ba1c952f4ea/backend/routers/sync.py#L797-L802) and [observes age on batch admission](https://github.com/BasedHardware/omi/blob/ba1c952f4ea/backend/routers/sync.py#L1424-L1431). | | #26319 F2 | Already resolved by the [recovered-WAL marker](https://github.com/BasedHardware/omi/blob/ba1c952f4ea/app/lib/services/wals/local_wal_sync.dart#L325-L327) and the [fresh-only guard filter](https://github.com/BasedHardware/omi/blob/ba1c952f4ea/backend/docs/runbooks/batch-upload-coalescing.md#L98-L103). [Independent comparison](https://github.com/BasedHardware/omi/blob/ba1c952f4ea/backend/routers/sync.py#L841) catches mismatches. | | #26319 F4 | Tests pin the flag key, refresh cadence, and immediate release and wake when a refresh completes. | | #26319 F5 | Proves the actual v2 headers and both histogram series for all three active states through the hermetic coalescing/publication path. The [runbook](https://github.com/BasedHardware/omi/blob/c9a357986ee14f371b2d48e467020de7a530b996/backend/docs/listen_pusher_pipeline/changes/2026-11-25-mobile-upload-hold-metric.md#pre-ramp-latency-receipt) records the serving receipt requirements for SCA-4508. | | #26319 F6 | Disposal prevents a final buffer seal from creating a detached hold. A test closes a real buffer after disposal and verifies publication. | | #26319 F7 | Controller regression test verifies that session roll and capture end both release the active recording before the reporter runs. | | #26319 F8 | Held-only drains report pending work and preserve retry backoff. Tests exercise the local drain, aggregation, provider and coordinator. | | #26318 F1 | Tests send held mobile uploads through v2 offer, drain and durable publication in both merged and individual modes. | | #26318 F2 | Keeps the batch-admission phone-age family and adds the bounded gate from the general upload trace. The runbook documents the filter and the reason for each family. | | #26318 F3 | Accepts in-range ASCII decimal ages with leading zeroes and bounds significant digits before converting. Tests exercise padded valid and out-of-range ages. | ## Verification - 92 focused Flutter tests passed under `omi-heavy` with `flutter test -j "$OMI_HEAVY_CPUS"`. - 2,930 focused backend tests passed across six files selected by changed files under `omi-heavy`, including the real multipart route and strict completion transaction. - The complete backend changed-file selection also passed under `omi-heavy`. Across 243 files, 12,935 passed and 86 were expected failures. - Local repository preflight passed all 51 checks. The pipeline-lab affected scan selected no scenarios. - Serving samples and the actual ramp receipt are pending Release's serving canary. ## Product invariants affected - INV-CAP-1. Teardown and delayed drain reporting preserve the existing custody and WAL publication path. UI-Evidence: none Line-Count-Exception: app/lib/providers/sync_provider.dart | 1556 -> 1560 | Keep the provider idle and pass the held disposition to the coordinator. Line-Count-Exception: app/lib/services/wals/local_wal_sync.dart | 3362 -> 3368 | Distinguish a held-only pass while retaining the local copy retention sweep. Line-Count-Exception: backend/routers/sync.py | 4418 -> 4424 | Attach the existing upload trace to the phone-age observation at fresh admission. Failure-Class: none <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/BasedHardware/omi/pull/26519?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="View guided diff" src="https://www.cubic.dev/buttons/review-in-cubic-light.svg"></picture></a> <a href="https://www.cubic.dev/action/auto-fix/pr/BasedHardware/omi/26519?returnTo=https%3A%2F%2Fgithub.com%2FBasedHardware%2Fomi%2Fpull%2F26519&source=description" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"><img alt="Turn on auto-fix" src="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"></picture></a> <!-- End of auto-generated description by cubic. --> 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SCA-4372, PR 1 of 2. Release lands this before enabling or releasing the Flutter hold.
DESIGN:
X-Omi-Upload-Holdstate in the existing receipt and content-ledger writes. Missing or unrecognized values reportunknown.mobile-batch-upload-holddefaults off in Flutter. Off restores the immediate seal wake and releases held files on the next client tick that observes the flag.omi_batch_pipeline_unit_diarization_outcome_totaland measure batch reads per audio-hour. Compare the settled readback to SCA-4372 after adoption.hold_state, roll back when phone hold-age p90 fromomi_batch_pipeline_upload_hold_age_secondsplus server upload-to-transcript p90 fromomi_batch_pipeline_upload_to_transcript_secondsexceedsH + 300 s. H is 60 s forfg60and 300 s forbg300andfg_preview300. Missing cohort samples leave the guard blind. Sync observes the optionalX-Omi-Upload-Hold-Age-Mson fresh batch admission. It has no Firestore field or operation. All three Cloud Run GMP profiles retain both histograms. Filter queries to explicit states on labeled revisions during the backend roll.Product invariants affected
None.
Verification
omi-heavy run -- bash backend/test.sh test_batch_pipeline_projection.py test_batch_upload_measurements.py test_sync_future_early_parity.py test_batch_upload_gaps.py test_batch_coalescing_completion.py— 173 passed.Line-Count-Exception: backend/database/batch_pipeline_projection.py | 1548 -> 1550 | Publish the first durable sample before a post-commit callback can fail and leave only a replay.
Line-Count-Exception: backend/routers/sync.py | 4196 -> 4205 | Accept and observe the two optional phone hold telemetry headers at the existing sync endpoint.
Hold-age follow-up verification:
omi-heavy run -- bash backend/test.sh test_batch_upload_measurements.py test_sync_future_early_parity.py test_fleet_deployment.py— 99 passed.