Skip to content

M3 final: merge main (34ce4026) into integration - #23096

Merged
Git-on-my-level merged 44 commits into
integration/legacy-retirefrom
lr/01-m3-final-sync
Oct 21, 2026
Merged

Git-on-my-level merged 44 commits into
integration/legacy-retirefrom
lr/01-m3-final-sync

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Final main merge into integration/legacy-retire for M3: main 34ce402, 108 commits past the M3 prep merge (b859b78). #22427 (integration -> main) showed CONFLICTING again after the M3 review fixes landed.

Conflict:

Adaptations:

  • FallbackReason: gains the same three values, so record_fallback keeps them instead of other. test_soniox_local_delivery_deaths passes.

  • fallback.initialize_live_stt_exhausted_children: builds its live failure set from the enum. It runs at import, and importing live_reason there cycles when live_reason loads first (main's provider_resilience does). test_stt_circuit_trip_causes passes.

  • test_reason_label_enums: the live vocabulary is now 36.

  • Label-debt ratchet: +2 rows (stt: split local delivery deaths out of capacity_full; count breaker trip causes (P34) #23074 breaker trip causes), for lane 14.

  • Flag registry, CI budget (vs main) and dead-code checks: all pass.

  • tests/unit/_chat_router_test_harness.py: serves the real utils.observability.reasons under the stubbed package. It is loaded once per process, because it registers omi_reason_total. routers.chat reaches it through provider_resilience -> live_reason. Without it, CI failed every chat/messaging harness test with "utils.observability is not a package". All 25 test files that stub utils.observability now pass.

Verification: a targeted backend/test.sh run over 81 files is green. It covered:

  • main's tests changed since b859b78;
  • every live_reason consumer;
  • the M3 review-fix tests (legacy-dark router, enrichment route, ramp controller, provider STT, ledger cutover, workflow contracts, language guard).

Failure-Class: none
Line-Count-Exception: backend/routers/developer.py | 2892 -> 2899 | growth comes from main (sync merge), not from integration code
Line-Count-Exception: backend/routers/listen/receiver.py | 2777 -> 2780 | growth comes from main (sync merge), not from integration code
Line-Count-Exception: backend/utils/metrics.py | 1498 -> 1512 | growth comes from main (sync merge), not from integration code
Line-Count-Exception: backend/utils/stt/streaming.py | 2461 -> 2466 | growth comes from main (sync merge), not from integration code
UI-Evidence: none -- sync merge; the UI changes are main PRs that carried their own evidence

Product invariants affected

  • INV-CAP-1: the files come from main's own PRs (sync merge); integration adds no change.
  • INV-MEM-1: the files come from main's own PRs (sync merge); integration adds no change.
  • INV-MEM-4: the files come from main's own PRs (sync merge); integration adds no change.

Git-on-my-level and others added 30 commits October 21, 2026 19:01
…versation_cards_cache, canonical_statuses_dedupe)

Firestore reads loop: #22856 landed with the three memory levers absent
from FIRESTORE_READ_LEVERS (= OFF per default). Turn them on at the
observational 5% cohort; all other keys unchanged from the served
flag-off literal (18f90e1). set_levers.py replace-mode, complete
16-key literal; contract tests 121 green.

Loop: firestore-reads; ramp clock starts at the served revision.
Review round 1 of #23044 (one P1, three P2):

- A synced phone copy hid its on-device source from On the Way while the
  card still counted it, so a visible card could open "All recordings are
  synced". The twin is now hidden only when the phone copy stands for the
  whole recording (uploaded, or synced pieces covering its length), and
  the card lists exactly the rows On the Way renders.
- Retry-exhausted audio no longer inflates the progress denominator; the
  bell keeps the failure.
- Phone-local waiting audio gets a measured bar instead of an
  indeterminate "Processing".
- The device snapshot is memoized on the WAL list identity and the server
  flag selects on its own, so a per-chunk progress tick no longer rescans
  the inventory on the UI isolate.
Review round 2 of #23044 (two P1, one P2), ruled fixable in-PR by the
lead (bus 35acab):

- An uploaded same-id phone chunk hid its device source at any length,
  so mid-drain a 60 s uploaded first chunk made 179 min of device audio
  vanish from the card (which read "Processing") and On the Way.
  Uploaded and synced phone seconds now both count toward coverage; a
  phone copy hides its source only once it covers the source's length.
- The card's totals did not apply On the Way's piece-of-source fold: a
  20 min source plus its 15 min phone piece read "15 of 35 min". The
  snapshot now folds pieces into their source (shared
  SyncPendingWork.sourceOfPiece): the source stands for the whole
  recording and each piece counts once as audio that left the device.
- Phone-recorded audio counted as already moved ("180 of 180" with a
  full bar, flipping to "Processing" on upload). Moved now counts only
  audio that left device storage, so phone-only audio reads a measured
  "0 of 180 min" that fills as it uploads.
Tick live elapsed labels independently of server updates, preserve manual
speaker identity on revised segments, and snapshot lazy transcript membership.

Failure-Class: none
* feat(backend): retry transport timeouts in live held publication

A GCS upload or Firestore call whose HTTP/gRPC reply never arrived closed
the live held-audio socket with 1011 because run_transactional(transient=True)
restarted only Firestore throttle/contention classes; a requests ReadTimeout
surfaced from recover() and failed the flush (stt_cap_live_held
outcome=publication_failed, omi_held_content_publication_retry_total at 0).

Route transport faults through the transient predicate instead: requests
timeouts/connection errors/chunked truncation, urllib3 ProtocolError,
builtin ConnectionError, google.auth TransportError, and api_core RetryError
now restart the idempotent publication transaction with the existing
equal-jitter backoff (3 attempts, sleeps under 0.6s; worst case adds two
10s RPC timeouts per operation). The callables already re-read and refuse a
second increment, and GCS uploads replay against if_generation_match=0, so
an ambiguous success resolves as 412-plus-reload. upload_held_audio now
verifies the stored length on that 412 path (opt-in bound: manifest 128K,
fragments 32K) so a retry never adopts a foreign object at that identity.

Custody-deciding recovery reads and preconditioned cleanup writes outside
the transaction get a bounded no-sleep leaf retry, and post-commit garbage
cleanup defers on a transport fault instead of closing the socket over
durable audio. omi_held_content_publication_retry_total gains a closed-set
cause label (throttle|timeout|connection|other) so these episodes are
visible. Deliberately unchanged: bare TimeoutError (asyncio alias) stays
non-retryable, and _publish_for_recovery keeps its one-shot budget.

* test(backend): cover transport timeout retries in live held publication

Required cases: a ReadTimeout on upload followed by success publishes once
with retried_ok/timeout and no 1011; persistent timeouts exhaust the
budget and fail closed exactly as today, counted; an ambiguous upload that
landed before a lost commit reply is reused via the generation
precondition and never duplicated; a Firestore commit/read transport fault
(ReadTimeout, api_core RetryError) restarts once and is counted once.

Also covers the 412 size verification in upload_held_audio, the
no-sleep recovery-leaf retry, post-commit cleanup deferral, and the
closed-set cause labels. Existing single-throttle verification-read
scenarios moved from staged_unverified to retried_ok/throttle because the
bounded leaf retry now confirms the stored row.

* feat(backend): bound live held publication by a 12s end-to-end deadline

The retry budget could outlast the client heartbeat: a 10s GCS upload
replayed 3 times plus backoff stalls the listen receiver's inline flush
~30s under the sink lock, past the app's 20s ping/pong close window, and
leaf reads rode the Firestore client defaults (60s timeout under a 60s
retry deadline) rather than any caller deadline.

One PublicationBudget now spans every attempt, backoff sleep, and
custody-deciding leaf read of a live publication:

- run_transactional accepts the budget: restarts begin only while a 2s
  minimum slice remains, backoff never sleeps past the deadline, and an
  early stop is recorded as the same exhausted outcome (today's staged
  hand-off / 1011 fallback then runs with the failure it has).
- Every RPC timeout is derived from the time remaining at call time:
  reads and uploads shrink below the 10s ceiling, and each attempt's
  commit gets an explicit retry=None and remaining-time timeout via an
  instance-level _commit bind (google-cloud-firestore 2.20's Transaction
  commit forwards no timeout kwargs; the gapic defaults are 60s).
- Leaf retries pass explicit timeout=/retry=None, floored at a 2s
  confirmation slice so the fallback can still confirm a staged row just
  past a spent deadline; they stop retrying once it is spent.
- The redrive sweep shares seal(), so seal builds the larger 60s
  recovery deadline for expired_only visits; the live flush keeps 12s.
  Post-commit garbage cleanup derives from the same budget and defers to
  the sweep when it is spent.

Exception classification no longer trusts wrappers: an api_core
RetryError or google.auth TransportError is retried (and labeled) by its
inner fault, mirroring google-cloud-storage 2.18's retry predicate; one
wrapping a permanent fault or nothing at all stays non-retryable.

* test(backend): cover the publication deadline and wrapper-cause classification

Fake-clock coverage for the 12s end-to-end budget: persistent upload
timeouts end inside the deadline counted exhausted and fail closed with
1011; per-attempt read/upload timeouts shrink as the deadline drains
(10s, then what is left); the fallback's leaf reads run on the floored
2s confirmation slice with retry=None and never retry past a spent
deadline; seal() takes the 60s recovery deadline only for expired_only
sweep visits; run_transactional stops restarting with attempts left and
records exhausted, and the SDK commit bind issues retry=None with the
remaining timeout (and leaves non-SDK transactions untouched).

Wrapper-cause classification: a RetryError or TransportError wrapping a
retryable fault keeps the inner, accurate label (ReadTimeout -> timeout,
ConnectionError -> connection, DeadlineExceeded -> deadline_exceeded),
while one wrapping a permanent fault — or nothing at all — is not
retried.

* refactor(backend): limit held publication retries to immutable uploads

* test(backend): distinguish upload transport faults from caller timeouts

* refactor(backend): type the immutable upload coordinator

* refactor(backend): expose upload ownership and isolate SDK transport policy

* refactor(backend): preserve pending uploads across cancelled waiters
Tick live elapsed labels independently of server updates, preserve manual
speaker identity on revised segments, and snapshot lazy transcript membership.

Failure-Class: none
Tick live elapsed labels independently of server updates, preserve manual
speaker identity on revised segments, and snapshot lazy transcript membership.

Failure-Class: none
…very; log failure stages (#23051)

* fix(dream): retry turn ledger contention and expose failure stages

Retry atomic read-time aborts and SDK commit-exhaustion wrappers with the existing bounded transaction helper. Keep ambiguous failures unreplayed. Log payload-free exception class, stage and source location, including drain retries after capacity waits.

Co-Authored-By: Codex Sol <[email protected]>

* fix(dream): retry admission and discovery contention

Apply the existing bounded transaction-contention helper to owner acquisition and each discovery page. Preserve admission, reclamation and queued due-row semantics; classify exhausted contention explicitly in pass metrics. Refresh both discovery query-coverage digests and cover read-abort recovery plus exhaustion.

Validation: 557 passed, 1 deselected across seven targeted backend test files. Seven new regression cases fail on c88bae0 and pass with this change.

Co-Authored-By: Codex Sol <[email protected]>

---------

Co-authored-by: Codex Sol <[email protected]>
* fix(deps): bump proxy-addr to 2.0.8

* chore: re-run PR checks after adding Failure-Class declaration

---------

Co-authored-by: katsugtgz <[email protected]>
…conversation from text (#22900)

POST /v1/dev/user/conversations compared finished_at with started_at. A
timestamp without an offset next to one with an offset (or next to the
aware "now" default for started_at) made that comparison raise TypeError,
so the request failed with HTTP 500. The CLI sends naive values for
date-only flags, so `omi conversation create --finished-at 2026-10-20`
hit it.

Read a naive started_at/finished_at as UTC. Two naive timestamps were
already accepted and are still accepted; the request schema is unchanged.
`omi config set api_base` checks URLs since #19689, but the value a
command actually uses can also come from --api-base, $OMI_API_BASE, or
a config saved before that check, and none of those are checked. httpx
raises UnsupportedProtocol for `localhost:8000` or `ftp://...`, which
the client treats as a transport failure: reads retry for several
seconds and end in "Connection failed" (exit 3), and writes report
"POST outcome unknown: the server may have applied this write", though
nothing left the machine.

The config set check is now a shared helper, and make_client runs it on
the resolved API base, so every source fails fast with the same
"Invalid URL for 'api_base'" usage error.
…pendant is listed again (#22895)

FlashPageWalSyncImpl.syncWal looked the recording up by object in its list.
That list is rebuilt with new Wal objects when the pendant connects, on
every discovery wake and after each sync pass, while the recording page
keeps the Wal it was opened with. Since #22417 the relisted recording keeps
its id, but the lookup by object still found nothing, so Transfer to Phone
failed with "Device recording list changed; go back and try again" for a
recording that was still listed.

Match by id and storage, as deleteWal and the SD card sync (#22414) do, and
run the transfer on the listed entry. A recording that is no longer listed
still fails without asking the pendant for audio.
Review round 3 of #23044 (one P1): a synced phone piece was skipped by
the card's row filter, so a chunk resolving uploaded -> synced rewound
the bar ("1 of 180 min" back to "0 of 180 min"), and chunks after the
first carry later starts — different ids — so id-based coverage never
summed a full drain and its lagging source stayed visible at zero.

- deviceCatchUpLocal folds synced pieces of a still-visible source into
  moved audio exactly like uploaded ones; a synced wal that is no
  visible source's piece stays unlisted (done).
- hiddenDeviceTwinIds sums coverage over the source's recording span
  (same-id copies or drain pieces with on-device originalStorage), so a
  fully synced chunk drain hides its lagging source instead of showing
  an empty "0 of N", with one time-window check to keep the pass linear
  on large inventories.

Not pushed: round 3 found a new P1, so the lane stops and asks the lead
before publishing or starting another review round.
…le headers

Nightly 39610825548 (first full run after #23042) failed on two reds that run
39586610411 could not report because both jobs fail fast: the Formatting job
died at the dart step so its Python step never ran, and Hygiene died at
screen-activity so lifecycle-headers never ran. Per lead ruling 482ff7 this
clears both and stops the masking.

- scripts/backend-python-format on the four test files the nightly flagged:
  test_conversations_batch_chunking.py, test_conversations_share_email_
  sanitization.py, test_diarizer_embedding.py, test_language_catalog.py.
- lifecycle-headers: the 8 designated files the nightly reaches that no PR
  ever re-validated. The 7 *_readiness/*_proof scripts become LIFECYCLE:
  one-time with DELETE-AFTER INV-MEM-3 (grants, firestore rules, MCP scope,
  P1.5 tools surfaces) or INV-MEM-2 (pinecone repair, vector repair outbox,
  vector search provider — the vector-hydration invariant names the repair
  outbox); rollout_cli.py becomes LIFECYCLE: permanent (operator tool).
  Their stale headerless entries leave the lifecycle baseline.
- run_checks.py gains --keep-going: run every selected check and report all
  failures instead of stopping at the first. The three nightly invocations
  (repo-checks Hygiene, mobile-app-checks iOS, desktop-swift-ci) pass it in
  their nightly_main_sha branch; PR and local lanes keep fail-fast. The
  repo-checks Python-format step now runs with !cancelled() so a dart-format
  failure cannot mask Python-format findings (39610825548).

Contract tests: keep_going runs all checks and names each failure; the
repo-checks nightly-branch regex tolerates trailing nightly-only flags.
…ames (#23054)

## What changed and why

P33: live episode timers now advance each second using a local wall
clock, independent of segment delivery and the unchanged 30-second
server poll. Only the time display rebuilds on the live page; the shared
live duration formatter keeps seconds in longer sessions too.

Manual owner/person labels survive revisions of existing live segments,
translations, and same-conversation refreshes as well as new lines.
Individual-line tags stay individual, and conversation rollover clears
the speaker default. The live transcript also snapshots list membership
for its lazy delegate: mutating the capture list after the delegate
records its item count otherwise produces a reproducible `RangeError`.

**Crash attribution remains open:** the reproduced Dart range error is
verified, but is not yet proven to be David's native iOS exit. At
14:18Z, 14:38Z, and 14:58Z ASC's latest native crash submission was Oct
18/build 1413 and Crashlytics returned no 1431 events in the Oct 21
report window. The lead is requesting the .ips; no exception or top
frames from David's incident are available yet. ASC separately confirms
build 1431 is valid and version 1.0.571. No customer content or
identifiers were read or included. Crashlytics access used GCP tier
`ro-prod`.

## Product invariants affected

INV-UI-3: `OmiDuration.live` extends the shared duration primitive with
localized seconds; existing compact durations keep their behavior.
INV-PERF-1: the 1-second tick is scoped to the elapsed label, not the
capture provider or transcript.

INV-CAP-1: capture edits affect transcript label projection only; audio
ingestion, retention, uplink ownership, and capture control paths retain
their current behavior.

## How it was verified

- 118 targeted Flutter tests pass: fake-clock per-second ticks on Home
and the live page, minute rollover, no extra server reads, timer
disposal, append/revise/translation/refresh label retention, individual
tags, newer server manual edits, conversation-scope isolation, and
localized long live durations.
- The lazy-delegate regression failed before the snapshot with
`RangeError (length): ... 0..1: 69` and passes after it.
- Visual audit passed at base `fd343aa34aba` and head `73b0a5afd7a`;
both production-widget captures were visually inspected. Artifacts are
outside Git under
`/Volumes/Ephemeral/scratch/episodes-live-fixes/visual-verified/`.
- `make preflight`: 24 selected checks passed. The final revision also
passed the bounded push gate, including generated-output checks.
- Independent Luna review via `infra/rollout/bin/review.sh` round 1:
SHIP; no P0/P1. One P2 about live-region timer announcements is deferred
to #23055 under the urgent lane rules.
- Native crash attribution, installed-device acceptance, and TestFlight
rebuild remain with the lead. No backend/listen deploy is needed for
these client changes.

## Tests

`app/test/widgets/episodes_ui_test.dart`,
`app/test/providers/capture_provider_test.dart`,
`app/test/unit/ui_format/omi_duration_test.dart`; visual-audit scenario
`episodes-live-transcript`.

## UI evidence

UI-Evidence: none -- before/after production-widget PNGs and gallery are
retained outside Git as required by the lane rules:
/Volumes/Ephemeral/scratch/episodes-live-fixes/visual-verified/gallery.html

## Failure class (fixes)

Failure-Class: none
Luna round 1 on PR #23064 (verdict SHIP, no P0/P1) flagged two deferrable-but-cheap
items that are fixed here so tonight's redispatch reports the full set:

- repo-checks `Check ARB formatting` gets the same `!cancelled()` guard as the
  Python step: a dart-format failure previously skipped the ARB step, so an ARB
  red would stay hidden until a nightly where Dart was clean.
- New contract test pins `--keep-going` inside the nightly branch of all three
  run_checks.py calls (repo-checks, mobile-app-checks, desktop-swift-ci), so a
  later workflow edit cannot silently return the nightly to one-red-per-run.

Deferred with the review's blessing (P2/minor, follow-up): `always() && !cancelled()`
phase verdicts for the iOS job's post-manifest compile steps (desktop-swift-ci
pattern), and a dedicated failure class whose prevention artifact is the
keep-going test instead of reusing FC-path-filter-masks-default-branch-health.
… one

At 14:20-14:52Z on 2026-10-21 the prod deploy job waited ~30 min for a
runner: five main merges in a few minutes each started the full Desktop,
Mobile, Repo, Backend and E2E sets, and every run on an older main SHA was
superseded and wasted.

Heavy main-push workflows now share one ref-keyed concurrency group per
workflow with `cancel-in-progress: ${{ github.event_name == 'pull_request' }}`.
PR pushes still supersede that PR's older run. On main the running run
finishes and GitHub replaces only the pending run, so a merge burst costs
one running + one newest-pending run per workflow and the newest main SHA
always gets a complete run.

- backend-checks, desktop-checks, web-checks, repo-checks: an unconditional
  `cancel-in-progress: true` let a newer main merge cancel the running
  run; it is now conditional on pull_request.
- backend-unit-tests, backend-hermetic-e2e, mobile-app-checks: the non-PR
  group fallback was `run-{run_id}`, which gave every main push its own
  group so superseded suites all ran; it is now `github.ref`.
- python-cli-ci: had no concurrency; adds the same shape.
- desktop-swift-ci: unchanged. Its per-SHA main keying is load-bearing
  (plan-desktop-release.py requires exact-SHA checks) and its
  cancel-in-progress is already conditional.
- CodeQL is GitHub default setup (weekly schedule, no workflow file);
  nothing to edit.

Push path filters on desktop-checks and web-checks mirror the
detect-changes supersets that gate their jobs, so a main push outside the
component skips the workflow. mobile-app-checks and desktop-swift-ci keep
unfiltered push triggers: mobile release admission and desktop release
planning consume their push-event runs on the exact source SHA, so a
skipped push would leave that SHA unreleasable. The nightly workflow_call
runs keep their unique `nightly-{run_id}` group suffix and are unaffected.

Deploy workflows, release-eligibility, firestore index reconcile and the
nightly are untouched. .github/scripts/test_main_push_ci_economy.py locks
these invariants and the untouched set; ci-budget.yaml records the two
narrowed push triggers.
…23061)

addVocabularyWords only deduped against the already-saved vocabulary, not
against other words in the same batch, and kept blank entries. Typing
'omi, omi' saved two identical chips, and removeVocabularyWord then
deleted every entry equal to the tapped word on one x tap.

fixes #22793
… contention fix (#23065)

* config(dream): re-ramp paid owners to 5% with concurrency 8 after the contention fix

The first 5% sweep failed on Firestore Aborted contention (fixed in #23051).
Re-ramp at 5% and cap Dream workers at 8 on all four Cloud Run services.

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

* config(dream): classify DREAM_AGENT_CONCURRENCY as a deploy config binding

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
…oups

Review round 1 on #23069 (FIX-FIRST) found two correctness issues in the
collapse change:

P1 mobile-app-checks: a ref-keyed non-PR group let any newer event in the
group (a newer push, the 04:41 cron, a manual dispatch) replace the newest
*pending* push run. Mobile release admission requires a first-attempt
push-event Mobile Release Eligibility success on the exact release SHA; a
replaced pending run leaves a cancelled check that no rerun can re-mint
(attempt 2 does not count, push events do not replay). Push runs now key on
github.sha like desktop-swift-ci, and cron/dispatch keep per-run groups.

P2 backend-hermetic-e2e / backend-unit-tests: with the plain github.ref
fallback, the daily cron or a manual dispatch joined the push group and
could evict the newest pending push run (or be evicted by one), leaving a
cancelled push check that fails scripts/pre_push_ci_verified.py for that
SHA. The ref collapse is now guarded by github.event_name == 'push' so
only push events share the ref group; cron, dispatch and merge-queue
attempts keep per-run groups. Manual backend-unit-tests dispatches regain
their independent result.

test_main_push_ci_economy.py is updated to lock the three shapes: push-only
workflows collapse on the plain ref; scheduled/dispatched workflows guard
the collapse to push events; both release-evidence workflows keep per-SHA
push keys. backend test_workflow_contracts.py pins the push-guarded form.
Lead ruling (bus d02cce) after review rounds 2-4: drop the progress
math. Inventory-timestamp arithmetic for drain progress was wrong for
ring sources stamped now-estimate, Limitless flash stalls that rewrite
seconds to the remaining pages, and adjacent storage files sharing a
boundary second; each round surfaced another shape.

- Revert the round 2-4 coverage and piece-fold changes: a device twin
  is hidden by main's same-id rule (an uploaded or synced phone copy),
  and the card lists exactly the rows On the Way lists via the shared
  SyncPendingWork.syncingOf, so it can never open an empty page.
- The card shows no bar and no "X of Y min": a status line in On the
  Way's own words (waiting, downloading, uploading, transcribing, or
  the cooldown), the audio span, the target conversations and the
  On the Way link. The status reads sync state plus the memoized
  snapshot, never the WAL list, so a progress tick stays isolated.
- Tests cover the indeterminate state for a device backlog, phone-only
  audio and server-only work, plus the twin and terminal cases; the
  visual-audit scenario and changelog fragment say status, not progress.

Accurate drain progress is filed as follow-up debt on the bus.
…le headers (#23064)

## Summary

Follow-up to #23042 per lead ruling 482ff7. The first full nightly after
that merge

([39610825548](https://github.com/BasedHardware/omi/actions/runs/39610825548),
main
pinned at 904dd65) failed on two reds that the earlier nightly
39586610411
**could not report**, because both jobs fail fast: the Formatting job
died at its dart
step so the Python-format step never ran, and Hygiene died at
screen-activity so
`lifecycle-headers` never ran. #23042's fixes let the nightly get one
layer deeper and
expose them. This PR clears both and stops the masking so one nightly
reports the full set.

1. **Formatting / Python step** — `scripts/backend-python-format
--write` on the four
files the nightly flagged:
`backend/tests/unit/test_conversations_batch_chunking.py`,
`test_conversations_share_email_sanitization.py`,
`test_diarizer_embedding.py`,
   `test_language_catalog.py`. Format only.
2. **Hygiene / `lifecycle-headers`** — the 8 designated files the
nightly reaches but no
PR ever re-validated (PR mode checks changed files only). Per the
ruling: the 7
`*_readiness` / `*_proof` scripts become `# LIFECYCLE: one-time`;
`rollout_cli.py`
becomes `# LIFECYCLE: permanent` (operator tool). One-time files need
exactly one
`DELETE-AFTER` reference, chosen from the invariant that owns each
script's subject
   (all are v17 memory-program scaffolding, renamed in Wave G14):
- `INV-MEM-3` (universal memory authority: grants, rules, MCP, tools
surfaces):
`app_key_memory_grant_assignment_readiness`,
`firestore_rules_iam_proof`,
`mcp_api_key_scope_readiness`,
`p1_5_tools_fastapi_testclient_readiness`.
- `INV-MEM-2` (vector hydration; names the vector repair outbox
verbatim):
`pinecone_repair_validation_readiness`,
`vector_repair_outbox_oidc_iam_proof`,
     `vector_search_provider_readiness`.
Their now-stale headerless entries leave
`.github/lifecycle-header-baseline.txt`
   (the checker requires the baseline to match exactly).
3. **Structural — nightly continues past failures.**
- `run_checks.py` gains `--keep-going`: run every selected check and
name each failure
instead of stopping at the first. PR and local lanes keep fail-fast
(unchanged
default). Wired into the three nightly invocations' `nightly_main_sha`
branch only.
- repo-checks `Check Python formatting` runs with `!cancelled()` so a
dart-format
     failure cannot hide Python-format findings.

### Exact `.github` changes (existing workflows only; no new workflow —
ruling 482ff7)

- `.github/workflows/repo-checks.yml` — nightly branch of the Hygiene
`run_checks.py`
call adds `--keep-going`; `Check Python formatting` gets `if: ${{
!cancelled() && … }}`.
- `.github/workflows/mobile-app-checks.yml` — nightly branch of the iOS
manifest call
  adds `--keep-going`.
- `.github/workflows/desktop-swift-ci.yml` — nightly branch of the macOS
manifest call
  adds `--keep-going`.
- `.github/scripts/run_checks.py` — new `--keep-going` flag
(`keep_going` already
  existed for `--metadata-only`).
- `.github/scripts/test_run_checks.py` — new contract test: fail-fast
stops at the first
failure and names it; `keep_going` runs all and names each (`first,
third`). The
repo-checks nightly-branch strip regex now tolerates trailing
nightly-only flags.
- `.github/lifecycle-header-baseline.txt` — 8 stale entries removed.

## Product invariants affected

INV-MEM-1, INV-MEM-4 — named because the lifecycle-header edits touch
files under their
path globs. The edits add header comment lines only (`# LIFECYCLE:` / `#
DELETE-AFTER:`);
no behavior changes in any invariant surface.

## Failure class

Failure-Class: FC-path-filter-masks-default-branch-health

That class's canonical prevention is an authoritative recurring health
run that forces
the real phases against the current main SHA. This PR hardens that same
guard: with
fail-fast, the nightly established health only up to the first red per
job, so three
reds hid behind one another across two runs (dart → python format;
screen-activity →
lifecycle-headers). `--keep-going` and `!cancelled()` make one nightly
report the full
set, which is the property the class exists to restore.

## Verification (this worktree, base 3f54aba)

- `run_checks.py --check-id lifecycle-headers` (local lane, against the
working tree):
  FAIL with the 8 files before → PASS after headers + baseline update.
- `scripts/backend-python-format --check` on all 12 changed backend
files: 12 unchanged.
- `.github/scripts/test_run_checks.py` (check-manifest-contract): 63/63
incl. the new
  keep-going test.
- `.github/scripts/test_check_lifecycle_headers.py`: 10/10.
- `actionlint` on the three workflows: no new findings (the two
shellcheck notes in
desktop-swift-ci.yml pre-date this PR at HEAD; CI runs actionlint with
shellcheck off).

## Notes

- No deploy needed: CI scripts/workflows, test formatting, and header
comments only.
- After merge: redispatch `main_nightly_full.yml` on main; expected
result green, and
if not, the run now lists every failing check per job instead of the
first.


<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/BasedHardware/omi/pull/23064?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/23064?returnTo=https%3A%2F%2Fgithub.com%2FBasedHardware%2Fomi%2Fpull%2F23064&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. -->
…trip causes (P34)

Live Soniox legs at peak died through _mark_dead(typed_reason='capacity_full')
for three local causes (send queue full, replay send stalled, live delivery
expired) while the vendor closed nothing, and omi_fallback_total read that as
Parakeet capacity (P32, 2026-10-21). Telemetry and labels only:

- three typed reasons (send_queue_full, replay_send_stalled, delivery_expired)
  at every Soniox/Modulate-leg local site: SafeSonioxSocket, SafeModulateSocket,
  ReplayTailSocket (tail bound, unconfirmed write), IdleSonioxSocket pending
  bound, replay prefix wall budget; capacity_full now means destination capacity
- one bounded WARNING per local delivery death: subtype, queue packets, queue
  age, seconds since the last successful write, session age (no UID, no content)
- omi_stt_provider_circuit_trip_total{provider,kind,error_class}: one count per
  real closed/half-open->open transition, labeled with the serve-death or
  connect-failure reason; breaker record_* methods take an optional error_class
  that never changes which bench opens

Censoring, failure phase, reconnect allowlists and record_rejection are
untouched for the new tokens. Vocabulary, demand-detail reasons, connect error
classes and zero baselines extended; ARCHITECTURE.md row updated.
…versation_cards_cache, canonical_statuses_dedupe) (#23035)

## Summary

Firestore reads loop config: enable the three merged-but-dark memory
levers (#22856) at **5%** each. All other 13 keys unchanged from the
served flag-off literal (18f90e1, train K
`backend-f162bdb-39590246432-1` / listen 0bbf473 / pusher f162bdb):

- `memory_list_index_window` 0 → 5: caps per-request index-window reads
in memories list streams via caller-carried opaque cursor; invalid
cursor falls back to legacy behavior.
- `mcp_conversation_cards_cache` 0 → 5: mcp conversation cards
exact-size refills with read cap (`FSR_MCP_CARDS_MAX_READS`, default
1501).
- `canonical_statuses_dedupe` 0 → 5: canonical-status pairs read via
`<=30`-ID `__name__ IN` reference queries instead of two full-collection
status reads.

Predicted (levers.json, measured at 100% equivalents 10-20, snapshot
2026-10-21T11:00:46Z origins):
`memories:_stream_memory_list_index_window`,
`mcp_conversation_pages:get_mcp_conversation_cards`,
`memory_service:canonical_statuses` — per-caller reads to be measured by
the ramp readout; per-loop rules the 5% window is observational (guard +
expected-signal check), no savings claimed until 100% + readout.

Rationale: #22856 served yesterday inside train windows with the three
keys absent (= OFF per `firestore_read_levers.py`), so the levers are
merged-but-dark (runbook 2026-10-20 lesson: merged-but-dark is not
progress). One config change in flight per loop phase rules;
`singleton_loops` 25 → 100 stays deferred pending the lease-rework
evidence (WQ1).

Config only, generated with `avo/firestore-reads/set_levers.py`
(REPLACE-mode, complete 16-key literal at all sites): `_base.yaml` +
regenerated `runtime_env.yaml`, listen/pusher dev+prod values, flag
registry, and the two pinned contract tests (121 passed locally).

## Product invariants affected

- INV-MEM-4 — config-only rollout of default-off code-path levers; every
lever reverts at 0 with no data-path or authority change.
- INV-DATA-1 — value-only edit of the existing `FIRESTORE_READ_LEVERS`
key; no routing or ownership change.

## Test plan

- `backend/tests/unit/test_verify_pusher_config_references.py` +
`backend/tests/unit/test_render_backend_runtime_env.py`: 121 passed on
this branch.
- Post-merge watch: verify.py per-lever gates + backend/backend-sync 5xx
rates at the 5% cohort (no lever-specific guard exemption requested).

## Rollout

1. Train order **listen → pusher → Cloud Run** (FIRESTORE_READ_LEVERS
order; Cloud Run candidate check compares GKE env against main's
runtime_env).
2. Handoff to the two-lane lead via bus after merge (URGENT not required
— no guard breach); ramp clock starts at the served revision carrying
this literal.
3. Ramp rule: 5% ≥ 3h with verify PASS (no lever UNSAFE/FALSIFIED) →
config PR to 100% for SUPPORTED levers; 0 for FALSIFIED/UNSAFE.


<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/BasedHardware/omi/pull/23035?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/23035?returnTo=https%3A%2F%2Fgithub.com%2FBasedHardware%2Fomi%2Fpull%2F23035&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. -->
… one (#23069)

## What changed and why

At 14:20–14:52Z on 2026-10-21 the prod deploy job (`gcp_backend.yml`
deploy) waited ~30 min for a runner after five main merges in a few
minutes each fanned out the full Desktop, Mobile, Repo, Backend and E2E
sets — every run on an older main SHA was superseded and wasted. Heavy
main-push CI workflows now collapse superseded main runs without
starving or cancelling: one ref-keyed concurrency group per workflow
with `cancel-in-progress: ${{ github.event_name == 'pull_request' }}`. A
newer main push replaces only the *pending* run in the group, so the
running one finishes and the newest main SHA runs next; PR pushes still
cancel that PR's older run. Named by David on 10-21 ("have glm do the
structural fix").

### Workflow table (before → after)

| Workflow | Push trigger | Concurrency before | Concurrency after |
| --- | --- | --- | --- |
| CodeQL | not a workflow: GitHub default setup, weekly schedule
(`code-scanning/default-setup`: state=configured, schedule=weekly). No
workflow file exists, so there is nothing to edit and it does not
contribute to main-push contention. | n/a | unchanged |
| Desktop Swift CI (`desktop-swift-ci.yml`) | push main, unfiltered
(kept) | per-SHA group `desktop-swift-${{ pr \|\| github.sha }}`, cancel
on PR only | unchanged — already implements no-starvation; per-SHA
keying is load-bearing for `plan-desktop-release.py` exact-SHA evidence
|
| Desktop Checks (`desktop-checks.yml`) | push main, unfiltered →
**path-filtered** (detect-changes agent-runtime superset) | `pr \|\|
ref` group, `cancel-in-progress: true` (newer merge cancelled the
running run) | same group, `cancel-in-progress: ${{ github.event_name ==
'pull_request' }}` |
| Mobile App Checks (`mobile-app-checks.yml`) | push main, unfiltered
(kept — see below) | non-PR key `run-{run_id}`, cancel on PR only | push
key **`github.sha`** (per-SHA, like desktop-swift-ci); cron/dispatch
keep per-run groups; cancel on PR only. **Not collapsed** — see review
round 1 below |
| Repo Checks (`repo-checks.yml`) | push main, unfiltered (metadata/code
lane split kept) | `pr \|\| ref` + lane group, `cancel-in-progress:
true` | same group, cancel on PR only |
| Backend Checks (`backend-checks.yml`) | push main, unfiltered
(job-level detect-changes gating already skips heavy jobs) | `pr \|\|
ref` group, `cancel-in-progress: true` | same group, cancel on PR only |
| Backend Unit Tests (`backend-unit-tests.yml`) | push main, already
path-filtered (48 filters) | non-PR key `run-{run_id}` (no collapsing),
`cancel-in-progress: true` | push key `github.ref` (guarded by
`event_name == 'push'`); manual dispatch keeps per-run group; cancel on
PR only |
| Backend Hermetic E2E (`backend-hermetic-e2e.yml`) | push main, PR,
schedule, merge_group, unfiltered | non-PR key `run-{run_id}`, cancel on
PR only | push key `github.ref` (guarded by `event_name == 'push'`);
cron/dispatch/merge-queue keep per-run groups; cancel on PR only |
| Web Checks (`web-checks.yml`) | push main, unfiltered →
**path-filtered** (web trees superset) | `pr \|\| ref` group,
`cancel-in-progress: true` | same group, cancel on PR only |
| Python CLI (`python-cli-ci.yml`) | push main, already path-filtered |
none | new: `python-cli-ci-` group, PR-number / `github.ref` key, cancel
on PR only |

All changed groups keep the `nightly-{run_id}` suffix so nightly
`workflow_call` runs stay isolated; the nightly itself is untouched.

### Required checks and why path filters are safe here

Branch protection on `main` requires exactly one check: **Mobile Release
Eligibility** (no rulesets add more). It is a job in
`mobile-app-checks.yml`, whose `pull_request` trigger is unfiltered and
unchanged — so merges are unaffected. It is *also* consumed from
**push-event** runs on the exact release SHA
(`verify_mobile_release_admission.py`: `mobile_aggregate.event ==
"push"`, `head_sha == source_sha`), so `mobile-app-checks` must **not**
gain push `paths` — a skipped push would leave that SHA without release
proof. For the same reason `desktop-swift-ci` keeps its unfiltered push
(`plan-desktop-release.py` requires its checks on the exact source SHA;
"skipped and absent checks" do not qualify). Desktop Checks and Web
Checks push runs have no such consumer, so they gain push path filters
mirroring the detect-changes filters that gate their jobs.

### How release eligibility still gets a complete run on the newest main
SHA

Release Eligibility (`release-eligibility.yml`) is untouched and re-runs
the canonical deterministic checks itself (`run_checks.py`) on the exact
checked-out SHA — it never depended on other workflows' push
conclusions. Mobile and desktop release admission consume **push-event**
runs per exact SHA, and GitHub concurrency replaces a *pending* run with
a newer one in the same group, leaving a `cancelled` check that no rerun
can re-mint (admission requires attempt 1; push events do not replay).
Both evidence workflows therefore key push runs on `github.sha` so no
main SHA's push run is ever evicted: Desktop Swift CI already did, and
Mobile App Checks now does (review round 1, P1). Mobile's expensive jobs
are path-gated inside the workflow, so a non-app merge costs only the
detect + aggregate jobs. Deploy workflows, `gcp_firestore_indexes.yml`,
and `main_nightly_full.yml` are untouched; their concurrency semantics
are load-bearing.

### Review round 1 (Luna/grok, FIX-FIRST → fixed in `ddbdfaa2d1c`)

- **P1** mobile-app-checks: ref-keyed push group let a newer push, the
04:41 cron, or a dispatch evict the newest pending push run →
unrecoverable loss of first-attempt per-SHA Mobile Release Eligibility
proof. Fixed: push runs key on `github.sha`; cron/dispatch keep per-run
groups.
- **P2** backend-hermetic-e2e / backend-unit-tests: cron/dispatch shared
the push group and could evict (or be evicted by) a push run, leaving a
`cancelled` push check that fails `scripts/pre_push_ci_verified.py`.
Fixed: ref collapse guarded by `github.event_name == 'push'`; cron,
dispatch and merge-queue attempts keep per-run groups.

## Product invariants affected

none — CI orchestration only, no product path changes.

## How it was verified

- `python3 .github/scripts/test_main_push_ci_economy.py` (new contract
test): 7/7 pass — asserts every group expression exactly across three
shapes (push-only ref collapse; push-guarded collapse for
scheduled/dispatched workflows; per-SHA push keys for the two
release-evidence workflows), cancel-in-progress conditional, nightly
isolation, path-filter mirrors, the two unfiltered-push exceptions, and
byte-stable concurrency for the untouched deploy/nightly/eligibility
workflows.
- `run_checks.py --lane ci --changed-files <diff>`: 43/43 manifest
checks pass, including `ci-budget` (validated against `origin/main`
base), `ci-budget-fixtures`, `main-push-ci-economy-contract`,
`backend-workflow-contracts`, runner-cost policy, apt/checkout bounds.
- `backend/test.sh` with
`BACKEND_UNIT_TEST_FILE_LIST=tests/unit/test_workflow_contracts.py`:
94/94 pass (updated pin for backend-unit-tests' push-guarded group).
- `check-deployment-concurrency.py`: OK (28 persistent writers) — deploy
groups untouched.
- `actionlint -shellcheck ""` on all eight edited workflows: clean.
- `gh api repos/BasedHardware/omi/branches/main/protection` (read-only):
required contexts = ["Mobile Release Eligibility"]; `gh api
repos/BasedHardware/omi/code-scanning/default-setup` confirmed CodeQL is
default-setup weekly, not a workflow.

## Tests

The new `.github/scripts/test_main_push_ci_economy.py` is the regression
test for this change (wired as `main-push-ci-economy-contract` in
`.github/checks-manifest.yaml`, triggered by every workflow it guards).
It would have caught both pre-existing failure shapes: unconditional
`cancel-in-progress: true` on a main-push workflow, and a `run-{run_id}`
non-PR key that lets superseded suites all run.

## UI evidence

UI-Evidence: none -- CI workflow orchestration only; no user-facing
surface changed.

Failure-Class: none

## New guards

Incident this guard would have caught: the 2026-10-21 14:20–14:52Z
prod-deploy runner starvation, where five rapid main merges queued
superseded full CI suites fleet-wide (also evidenced by the
unconditional `cancel-in-progress: true` shapes this test now rejects).
Not a shared primitive because the invariant is specific to workflow
YAML semantics that no existing check (ci-budget,
deployment-concurrency, actionlint) models: those validate cost
inventories, deploy locks, and expression syntax, not main-push
supersession behavior.

## Scoped cleanups

`.github/ci-budget.yaml` refreshed for the two narrowed push triggers
(desktop-checks, web-checks) with rationale lines; `check_ci_budget.py`
passes against `origin/main`.
## What changed and why

P30: a large offline-audio backlog, or a sync job without one target
conversation, no longer adds a standalone row to Home. The device page's
Catching up card now covers waiting transfers and server-only work,
shows a status line in On the Way's own words, the available audio span
and the target conversation titles/count, and opens On the Way. Progress
is deliberately **indeterminate** (no bar, no "X of Y min") per lead
ruling d02cce — see "Review history" below.

The inline "adding … from your Omi" status on a single conversation,
Recently log, and bell failure/retry entries remain in place. Uses
existing app typography, icons and localized copy; on by default.
Includes a mobile changelog fragment.

## Product invariants affected

none (routine UI change; existing INV-UI-1 and INV-UI-3 primitives
retained).

## How it was verified

- 116 targeted Flutter widget/performance/semantics tests passed at the
final head
(`/Volumes/Ephemeral/scratch/catching-up-row/p30b-tests-indeterminate3.log`):
Home backlog and loading states, server jobs with zero/one/several
targets, the device card's indeterminate state for a device backlog,
phone-only audio and server-only work, the synced-twin and
terminal-failure cases, device card navigation and clearing, 200% text
scaling, existing device controls, inline filling, bell attention/retry,
and sync notification isolation (the status line reads the memoized
snapshot, never the WAL list, so the per-tick inventory-read guard still
passes).
- `bash app/scripts/analyze_ratchet.sh` passed; no baseline changes.
- Production visual-audit harness renders passed for the first commit
(Home before/after, initial load, the large device backlog,
zero/multiple server targets; the card was tapped through to On the
Way). Synthetic fixtures only; no customer data or GCP tier used.
- `OMI_PR_BODY_FILE=<draft>` pre-push gate passed all selected checks on
every push. Exact-head GitHub workflow results are recorded before
merge. No physical-device or TestFlight build was performed; the next
TestFlight build picks up the merge.

## Tests

`home_pending_row_test.dart` and `home_processing_pending_row_test.dart`
assert no Home pending row through local backlog, upload/fetch, loading,
processing, and server-target states, and On the Way's twin/piece rules.
`device_catching_up_test.dart` covers the production device route:
status text with no `LinearProgressIndicator` for a device backlog,
phone-only audio and server-only work; known/unknown targets;
completion; a synced phone twin hiding the card instead of opening an
empty page; terminal failures never holding the card; accessibility.
`pending_work_test.dart` retains the real failure/retry checks and adds
a catch-up-only bell regression. Visual scenarios live in
`integration_test/visual_audit/scenarios/offline_processing.dart`.

## Review history (grok reviewer per `lane_routing.json`; 5 rounds,
rounds 3–5 lead-ruled)

- **Round 1 (FIX-FIRST)**: the card could open an empty On the Way page
(a synced same-id phone copy hid the device source on the page but not
on the card); per-tick inventory rescans; phone-only audio labelled
"Processing"; retry-exhausted audio padding the total. Fixed in
`9e2d4b36673`.
- **Rounds 2–4 (FIX-FIRST each)**: my attempts to compute drain progress
from WAL timestamps (coverage by id, then by recording span; folding
copied pieces into their source) kept surfacing real device shapes they
were wrong for — a short uploaded chunk hiding its whole source,
double-counted pieces, a bar rewinding when a chunk resolved to
`synced`, ring sources stamped `now − estimate`, Limitless flash stalls
rewriting `seconds` to the remaining pages, adjacent storage files
sharing a boundary second (`91cd49c37e9`, `3d574c226ed`).
- **Lead ruling d02cce**: drop the progress math. `2bbb01f6527` reverts
the round 2–4 coverage/fold changes to main's same-id twin rule, makes
the card list exactly On the Way's rows (shared
`SyncPendingWork.syncingOf`) so it can never open an empty page, removes
the bar and the "X of Y" line in favour of a status line
(`SyncPendingWork.stageLabelFor`), and keeps the memoized snapshot and
split selects from round 1. Accurate drain progress is filed as
follow-up debt on the swarm bus (reuse `SyncRunTracker`, the Offline
Sync page's high-water model).
- **Round 5 (FIX-FIRST) → lead ruling 7b88dc: merge.** The reviewer's P1
is main's pre-existing same-id twin hide (a first SD-card chunk shares
its source's id, so an uploaded/synced chunk hides the whole `miss`
source until the clear acknowledges); this PR restores that rule per
d02cce and makes the card consistent with On the Way rather than
introducing it. Its P2 (the span line uses `[timerStart,
timerStart+seconds]`, wrong for a Limitless flash stall that rewrites
`seconds` to the remaining pages) is deferred. Both are recorded in debt
item 04e112.

## UI evidence

Real Flutter widget captures at 390 × 844 logical pixels (Android
harness), using synthetic data. The harness has pre-existing missing
fallback-font glyphs in unrelated header/emoji text. The before Home
render was captured from base
`e2f942e7d8b6f77693d3a9873e346e4bccc319ac`; after renders were captured
at the first commit `02b900907dc`.

**Note:** captures 003–005 predate ruling d02cce and still show the
progress bar and the "0 of 180 min" line, which the final head no longer
renders (the status line, span, targets and link are unchanged). The
capture harness was not re-run inside the merge window; re-captures ride
the follow-up. The tracked `evidence.json` says so for 003.

| Before: Home with backlog | After: Home with the same backlog |
| --- | --- |
| ![Home
before](https://raw.githubusercontent.com/BasedHardware/omi/02b900907dc/.agent-artifacts/ui-evidence/catching-up-row/001-mobile-android-home-before.png)
| ![Home
after](https://raw.githubusercontent.com/BasedHardware/omi/02b900907dc/.agent-artifacts/ui-evidence/catching-up-row/002-mobile-android-home-after.png)
|

| Device: large backlog (pre-ruling, bar since removed) | Device:
several conversations | Device: targets unknown |
| --- | --- | --- |
| ![Large
backlog](https://raw.githubusercontent.com/BasedHardware/omi/02b900907dc/.agent-artifacts/ui-evidence/catching-up-row/003-mobile-android-device-large-backlog.png)
| ![Multiple
targets](https://raw.githubusercontent.com/BasedHardware/omi/02b900907dc/.agent-artifacts/ui-evidence/catching-up-row/004-mobile-android-device-multiple-targets.png)
| ![No target
yet](https://raw.githubusercontent.com/BasedHardware/omi/02b900907dc/.agent-artifacts/ui-evidence/catching-up-row/005-mobile-android-device-no-target.png)
|

![Device card opens On the
Way](https://raw.githubusercontent.com/BasedHardware/omi/02b900907dc/.agent-artifacts/ui-evidence/catching-up-row/006-mobile-android-device-on-the-way.png)

## Failure class (fixes)

Failure-Class: none

This implements the ratified episodes design placement; it does not
change sync execution or failure handling.
…conversation opens

Opening a conversation queued its analytics through
SchedulerBinding.scheduleTask(…, Priority.idle). While any ticker runs the
default scheduling strategy declines an idle task, and SchedulerBinding
re-arms a zero-delay timer every event-loop turn until it can run; with a
capture live, Home's live dot pulses indefinitely, so the UI isolate
busy-looped from the tap onward, through a processing conversation's
indeterminate bar, and on Home again after the pop. The analytics call now
defers with Timer.run, and the capture card's own 1-second setState stops
while the episode row draws the capture.

Guards in app/test/perf/home_after_detail_perf_test.dart: the scheduling
strategy is consulted zero times on open and the open still reaches
analytics; five ticks rebuild only LiveEpisodeClock; three open/close visits
leave no ticker or rebuild behind; ten list identity replacements cost one
shell build per mounted row each.

Failure-Class: new
…all token, true queue age

- receiver.py: the exhausted-recovery terminate reports the tail socket's typed
  local cause (live_stt_terminal_reason(delivery, 'send_queue_full')) instead of
  a hard-coded capacity_full; the same funnel, phase and circuit outcome
- resilient_stream.py + parakeet_window.fail: a successor that implements
  fail() (the Parakeet window) latches replay_send_stalled on the replay prefix
  wall, like the socket-level branch; its own buffer_cap/queue_timeout/admission
  stay capacity_full because there the destination refused
- send_queue.py: AudioSendQueue records each item's enqueue time and pops it as
  items are taken; soniox.py reads oldest_queued_age so queue_age_seconds is the
  oldest still-queued packet's wait, not time since the queue first filled
- provider_resilience.py: trip-counter zero children also cover auth and
  config_incomplete, which record_failure / record_account_failure emit

Not taken: the replay_delivery residence-deadline stall that surfaces as
connection_lost is unchanged from main and relabelling it would stop a circuit
vote; handed to the lead as a follow-up.
Git-on-my-level and others added 13 commits October 22, 2026 00:32
…local tokens

Round 1's receiver fix forwarded live_stt_terminal_reason(delivery, ...), which
let a tail that died without latching a local cause (a residence-deadline write
stall with the vendor socket open) resolve to the generic connection_lost and
vote on the serve-failure circuit from a site that had never voted. New
live_failure.local_tail_terminal_reason() forwards a local-delivery token when
the tail latched one and send_queue_full otherwise, so this site keeps its
pre-PR circuit semantics exactly while naming the local cause. Pinned by a
test; the residence-deadline label itself stays with the lead (pre-existing).
…ndow

Luna round 1 P2: the midnight rollover timer (armed from DateTime.now()) can
fire inside a measured 5-tick window on the fake clock, rebuilding the page
shell and with it the clock element, so the exact count of five could read six.
The clock now only has to tick each second; the shell bound (at most one
rebuild per window) carries the per-tick amplification guard.
The UUID-matched 1433 watchdog stack samples regexp canonicalization in
repairPass during conversation title rendering. Reuse fixed Unicode speaker
patterns and reject absent literal IDs before compiling boundary expressions.
A synthetic 30-row workload with 1500 transcript IDs per row takes 9.915s
before and 11.4ms after on the operator Mac. Preserve citation parity,
Unicode word boundaries and literal/overlapping-ID behavior in regression
tests, with a coarse watchdog-class workload budget.

Failure-Class: new
…conversation opens (#23076)

## What changed and why

P36: David reported Home scrolling "very laggy sometimes, like after
opening a conversation"
(iPhone, TestFlight 1.0.571, 10-21 22:35 local).

Root cause: `ConversationListItem._open` queued the "conversation
opened" analytics through
`SchedulerBinding.scheduleTask(…, Priority.idle)`. Flutter's default
scheduling strategy declines
an idle task while any ticker runs, and `_runTasks` then re-arms
`Timer.run` every event-loop
turn until the task can run. Home's live episode row pulses its dot for
as long as a capture is
live, so from the tap onward the UI isolate busy-looped: through the
push, through a processing
conversation's indeterminate bar (the detail page animates, so the task
still cannot run), and
again on Home after the pop, where the dot keeps it spinning
indefinitely. The same shape OOMs a
widget test: the pump never returns and the tester grows to 34 GB.

- `conversation_list_item.dart`: the analytics call is deferred with
`Timer.run` instead; it
still runs off the navigation frame and no longer depends on the
scheduler's priority gate.
- `processing_capture.dart`: the capture card's own 1-second ticker
skips `setState` while the
live episode row is drawing the capture (the card renders nothing then);
a call still ticks.

Measured and left as is: one list identity replacement rebuilds each
mounted row's shell once
(20 rows per update here; the per-row `Selector` keeps row content from
rebuilding), and
`ConversationDetailProvider.setProviders` still notifies on every
list-provider update (nothing on
Home listens to it, so no Home cost).

## Product invariants affected

INV-PERF-1 (named because this adds a guard): no idle-priority scheduler
task from a surface
that can animate.

Failure-Class: new

UI-Evidence: none -- no pixel changes: a deferred analytics call changes
how it is scheduled, and the capture card skips a setState while it
renders nothing; the Home render is unchanged.

## How it was verified

`app/test/perf/home_after_detail_perf_test.dart`, hermetic: the real
`ConversationsPage` with a
pushed `ConversationDetailPage` under the production provider wiring, a
streaming capture with
the pulsing live row, 30 list projections, and a 1500-line hydration
through the detail endpoint.

- Opening a row consults the binding's scheduling strategy 0 times (the
spy fails past 50; on
the old code it fails at 51), and the open is still reported to
analytics.
- Five 1-second ticks rebuild only the live row's clock
(`LiveEpisodeClock: 5`, no
`ConversationListItem`, at most one page-shell rebuild); the old capture
card ticked 5×.
- Three open/close visits leave `transientCallbackCount` at baseline
with the same tick profile.
- Ten identity replacements cost at most one shell build per mounted row
each; two flings build
  10 rows (bounded by the list length).

Both guards are red on origin/main and green with the fix. `flutter
test` over `test/perf`,
`test/pages/conversations`, `test/spine` and the 14 widget tests that
touch these files:
453 passed, 0 failed. `flutter analyze` on the changed files and
`check_mobile_ui_isolate.py --report`: clean. Layer: host widget tests;
not measured on a device.


<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/BasedHardware/omi/pull/23076?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/23076?returnTo=https%3A%2F%2Fgithub.com%2FBasedHardware%2Fomi%2Fpull%2F23076&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. -->
test_parakeet_window_live's serve-failure spy and test_live_routing_health's
SimpleNamespace stub took no arguments, so the trip-counter cause plumbing
(error_class=...) raised inside them and CI shards 2 and 4 failed with the spy
counting zero serve failures. Stubs now accept and forward the keyword; the
counting spy keeps calling through to the real breaker.
## What changed and why

Home title rendering could stall long enough for iOS to terminate the
app during a scene update. Build 1.0.571 (1433), sourced from
`8015f02c`, reports `EXC_CRASH / SIGKILL`, FRONTBOARD `0x8BADF00D`,
after exhausting a 10-second scene-update allowance.

UUID-matched App.framework and Flutter.framework dSYMs resolve the
sampled stack to `CharacterRange::Canonicalize -> RegExpParser ->
String.replaceAll -> repairPass (note_citations.dart:106) ->
repairNoteCitations -> presentableNoteTitle -> conversationRowTitle ->
ConversationListItem` during `WidgetsBinding.drawFrame`. The native
timer is the engine frame/vsync timer. This snapshot does not show
`SchedulerBinding._runTasks`; #23076 fixes a separately reproduced
idle-task spin.

Citation repair now reuses fixed Unicode speaker patterns and skips
per-ID Unicode boundary pattern construction when the literal ID is
absent. Rendering an ordinary short title previously compiled patterns
for every ID in its transcript, even though none appeared in the title.
Citation output and stored data remain unchanged.

## Product invariants affected

INV-PERF-1: remove repeated Unicode regexp compilation from the
title-rendering path. The new shared contract regression covers a long
transcript on each row.

Failure-Class: new

UI-Evidence: none -- presentation utility optimization, with existing
title rendering and citation parity tests preserved; no widget layout or
visible copy change.

## Verification

- 88 targeted Flutter tests passed: citation contract, title/fallback
behavior, list-row isolation, and detail-title rendering. New cases
cover overlapping literal IDs, BMP/astral Unicode boundaries and Arabic
digits in speaker labels.
- Identical synthetic host workload (30 short titles, 1500 IDs each):
old implementation **9.915 seconds**, fixed implementation **11.4
milliseconds**. The old implementation fails the new 3-second coarse
watchdog-class budget; the fixed implementation passes. These are host
measurements, not iPhone frame times.
- Full citation contract fixtures, protected Markdown/code/link cases
and title bracket preservation remain green.
- Native evidence identifies the expensive sampled path; physical-device
acceptance of the new binary remains required. No backend/listen
deployment is needed.

Crash artifacts contain private device metadata and remain outside Git.
This PR includes no raw crash report, production account data, user
identifiers, or credentials. Crashlytics access used `ro-prod`;
discovery-verified filters and full report view returned no issue groups
for builds 1431–1434, while an unfiltered positive control returned 25
groups. ASC also had no ingested incident submission; the device report
arrived directly.

`make preflight`: all 25 selected checks passed. Analyzer: no issues on
both changed Dart files. Independent Luna round 1 via
`infra/rollout/bin/review.sh`: SHIP, no P0/P1. Exact reviewed head:
`edf3fd773309358618fe757b30904b4536f72d80`.
Prepares App Store release notes for the next stable 1.0.571 build,
covering pendant audio continuity, scrolling/freezes/crashes,
catching-up status on the Device page, and the live recording timer.
Follows the existing 1.0.568 release JSON format and omits the
beta-gated episodes UI.

Store submission is separately gated on the processed TestFlight build
containing #23076, #23054, and #23044, green tests/CI and tester
eligibility. Submission will use MANUAL release with no phased release;
David controls release. Android rollout is unchanged.

Validation: mobile changelog schema and derived iOS notes passed; 14
preflight checks passed. Independent Luna review: SHIP, no P0/P1;
applied its suggested wording for catch-up details and the per-second
live-page timer. GitHub CI must finish green at the final head before
merge.

Product invariants: no production behavior changes (release-note data
only).
…ents

The SimpleNamespace fake circuit in test_live_router_hardening took zero
arguments for record_failure and one positional for record_account_failure,
so the trip-counter cause plumbing (error_class=..., keyword-only) raised
inside the fake and CI shard 4 failed on the endpoint-isolation and
saturated-target tests. The fakes now accept and ignore the keywords; a
sweep found no other zero-argument record_* stubs in the suite.
…trip causes (P34) (#23074)

## Summary
At peak on 2026-10-21, live Soniox legs died through `soniox.py
_mark_dead(typed_reason='capacity_full')` for three local causes — the
send queue filling, replay sends stalling, a live frame's delivery
deadline expiring — while the vendor closed nothing and the listen pods
sat near idle;
`omi_fallback_total{from_mode="soniox",to_mode="parakeet",reason="capacity_full"}`
then read as Parakeet capacity (P32). This PR is telemetry and labels
only. It splits those deaths into three typed reasons
(`send_queue_full`, `replay_send_stalled`, `delivery_expired`) at every
Soniox/Modulate-leg local site (`SafeSonioxSocket`,
`SafeModulateSocket`, the `ReplayTailSocket` tail bound and unconfirmed
write, the `IdleSonioxSocket` pending bound, the replay prefix wall
budget), adds one bounded WARNING per such death carrying queue depth
and age plus seconds since the last successful write (numbers only; no
UID, no content), and adds
`omi_stt_provider_circuit_trip_total{provider,kind,error_class}` so a
Parakeet selection breaker trip names its cause. `capacity_full` now
means destination capacity only (Parakeet admission / buffer_cap /
queue_timeout, allocation).

## Behavior change
None. The new tokens are censored exactly as `capacity_full` was
(`provider_observation` allowlist), take the same failure phase
(`connection`), stay outside the Soniox reconnect allowlists, and never
reach `record_rejection` (Parakeet-only). Breaker `record_failure` /
`record_serve_failure` / `record_account_failure` /
`record_account_rejection` gain an optional `error_class` keyword
consumed only by the counter; the bench they open is unchanged.
Re-arming an already-open breaker does not count as a trip.

## Rename recorded — how to read it
- The split, on the series the observability lane already reads:
`sum by (reason, to_mode)
(increase(omi_fallback_total{job="backend-listen-metrics",component="stt_live_session",from_mode="soniox"}[10m]))`
shows `send_queue_full` / `replay_send_stalled` / `delivery_expired`
where it showed `capacity_full`.
- Destination capacity, unchanged: `...reason="capacity_full"`
(Soniox/Modulate legs no longer contribute).
- Breaker trip causes: `sum by (provider, kind, error_class)
(increase(omi_stt_provider_circuit_trip_total{job="backend-listen-metrics"}[10m]))`.
- Death log line: `Soniox local delivery death subtype=<token>
queue_packets=<n> queue_age_seconds=<s> since_last_send_seconds=<s|-1>
session_age_seconds=<s>`.
- `omi_listen_demand_failure_detail_total` records the three reasons as
themselves (previously `other`); zero children pre-created.
- The alert `omi-stt-capacity-full-exhausted` (outcome=exhausted,
volume-guarded) narrows to destination capacity; Soniox/Modulate local
deaths that exhaust the chain leave its scope (1 of 36 events in P32's
14:00–14:10 sample). Flagged to the observability lane; not edited here.
- The Parakeet-window successor's replay prefix wall now latches
`replay_send_stalled` too (review round 1), so every local wall expiry
carries the same token regardless of successor type; the window's own
`buffer_cap` / `queue_timeout` / `admission` stay `capacity_full`
because those are the destination refusing.

## Review round 1 (grok, FIX-FIRST) — what changed
- `receiver.py` exhausted-recovery terminate: reports the tail socket's
typed local cause (`live_stt_terminal_reason(delivery,
'send_queue_full')`) instead of a hard-coded `capacity_full`.
- `resilient_stream.py` + `parakeet_window.fail`: the window successor's
replay wall latches `replay_send_stalled` (above).
- `send_queue.py` / `soniox.py`: `queue_age_seconds` is now the oldest
*still-queued* packet's wait (per-item enqueue times popped as items are
taken), not time since the queue first became non-empty; a session that
stays one packet ahead no longer reports its session age.
- `provider_resilience.py`: trip-counter zero children also cover `auth`
and `config_incomplete`.
- **Not taken — `replay_delivery.py` residence-deadline write stall
reported as `connection_lost`:** that branch (`clock() >=
packet_deadline` with the vendor socket alive → `_local_reason` unset →
`connection_lost` → serve-failure circuit vote) is unchanged from
`main`; this PR only renamed the token in the sibling branch.
Relabelling it would stop a circuit vote that fires today, which is a
behavior change outside this telemetry-only PR. Handed to the lead as a
follow-up with the exact branch.

## Review round 2 (grok, delta, FIX-FIRST) — what changed
The round-2 blocker was a regression I introduced in round 1's receiver
fix: forwarding `live_stt_terminal_reason(delivery, …)` let a tail that
died without a local cause (the residence-deadline stall) resolve to the
generic `connection_lost` and vote on the serve-failure circuit from a
site that never voted before. Fixed:
`live_failure.local_tail_terminal_reason()` forwards only local-delivery
tokens (else `send_queue_full`, the bound this site observed), so the
exhausted-recovery terminate keeps exactly its pre-PR circuit semantics
(never votes) while naming the local cause when the tail latched one.
Pinned by
`test_exhausted_tail_terminate_forwards_only_local_tokens_never_a_circuit_vote`.
The underlying residence-deadline label (`connection_lost` where
`delivery_expired` is true) remains pre-existing and with the lead (see
round 1). Round cap reached; lead rules on merge.

## Lane / contract
Lane soniox-telemetry (P34). Contract rows in `swarm/contracts.md`:
`omi_fallback_total` local-delivery reasons;
`omi_stt_provider_circuit_trip_total`. Owner sign-offs for other lanes'
files: none needed.

## Product invariants affected
none

## Verification
`backend/test.sh` with `BACKEND_UNIT_TEST_FILE_LIST` (unit layer, under
`omi-heavy`): new `test_soniox_local_delivery_deaths.py` (each subtype,
the bounded diagnostic line and its -1 sentinel, oldest-queued age, the
window-successor wall, censoring, `omi_fallback_total` passthrough) and
`test_stt_circuit_trip_causes.py` (serve, threshold, half-open re-trip,
account, untyped, unlabelled breaker, the live-failure→streaming funnel,
zero children); existing live replay / recovery matrix / canary /
shutdown-tail / evidence settlement / health reconciliation (now
parametrized with the window token) / chain / resilience / fallback /
cardinality / connect-fallback suites updated to the new tokens and the
breaker's `error_class` keyword. Round-1 batch 710 passed; round-2
affected set 583 passed. Not run: the full backend suite, any live or
prod check.

## Rollback
Revert the PR. No flags, no data migration.

Failure-Class: none
Line-Count-Exception: backend/utils/stt/streaming.py | 2461 -> 2466 |
SafeModulateSocket's three local-delivery typed reasons and the breaker
cause plumbing live in this module
Line-Count-Exception: backend/utils/metrics.py | 1498 -> 1512 |
omi_stt_provider_circuit_trip_total is defined beside its gauge sibling
omi_stt_provider_circuit_open, where every other STT metric lives
Line-Count-Exception: backend/routers/listen/receiver.py | 2777 -> 2780
| the exhausted-recovery terminate reports the tail's typed local cause
via local_tail_terminal_reason instead of a hard-coded capacity_full
(review rounds 1-2)
Main moved 108 commits past the M3 prep merge (b859b78); one conflict:
- backend/utils/stt/live_reason.py: keep integration's LiveSttReason-backed sets and add
  main's #23074 local-delivery death reasons (send_queue_full, replay_send_stalled,
  delivery_expired) as LiveSttReason members plus main's LOCAL_DELIVERY_* constants.
Label-debt ratchet: +2 rows (#23074 breaker trip causes), for lane 14.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ration enums; break the live_reason import cycle (M3 final merge)

- FallbackReason gains send_queue_full, replay_send_stalled, delivery_expired (already in
  LiveSttReason), so record_fallback keeps them instead of 'other'.
- fallback.initialize_live_stt_exhausted_children builds the live failure set from the
  LiveSttReason enum: it runs at import, and importing utils.stt.live_reason there cycles
  when live_reason loads first (main's provider_resilience import order).
- test_reason_label_enums: the live vocabulary is 36 with #23074.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-21T20:17:22.249811Z 36e753b New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

…ls.observability (M3 final merge)

routers.chat -> utils.stt.provider_resilience -> utils.stt.live_reason now imports
utils.observability.reasons (main #23074 x integration's reason enums). The chat router
harness stubs utils.observability as a plain module, so ~60 chat/messaging tests failed
with 'utils.observability is not a package'. Load reasons.py once per process (it
registers omi_reason_total) and install it under the stub.

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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 36e753bbb6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 18 to +19
static String runningLength(Duration elapsed, AppLocalizations l10n) {
final seconds = elapsed.inSeconds < 60 ? elapsed.inSeconds : (elapsed.inSeconds ~/ 60) * 60;
return OmiDuration.compact(seconds, l10n);
return OmiDuration.live(elapsed.inSeconds, l10n);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Tick the device live duration every second

When a live device capture is silent or produces no new transcript segments, the Device page does not rebuild: device_settings.dart selects only the capture source and last segment end, and unlike the Home row and live page it is not wrapped in LiveEpisodeClock. After this change makes runningLength second-precise, the displayed duration therefore freezes until some unrelated provider notification changes selected state, violating the new OmiDuration.live contract that an elapsed live length keeps ticking every second. Add the same leaf clock around the Device live row rather than relying on capture updates.

AGENTS.md reference: app/AGENTS.md:L3-L4

Useful? React with 👍 / 👎.

@Git-on-my-level
Git-on-my-level merged commit 36e753b into integration/legacy-retire Oct 21, 2026
31 of 33 checks passed
@Git-on-my-level
Git-on-my-level deleted the lr/01-m3-final-sync branch October 21, 2026 20:44
Git-on-my-level added a commit that referenced this pull request Oct 21, 2026
## Summary

M3: land the legacy-sync retirement integration branch
(`integration/legacy-retire`, swarm plan
`omi-knowledge-base/projects/backend-target-architecture/swarm-plan.md`,
contracts in `contracts.md`) on main. **Merge with `--merge` (never
squash)**; the lead runs the train from the main merge SHA.

**Prod behaviour after this merge:** prod `legacy_sync` stays `on`.
Every new legacy-retirement path is gated: the ramp document,
default-off flags or kill switches, and the `DRAINING_PRECONDITIONS`
that `ramp_set` enforces before leaving `on`. With the mode `on`,
intake, sync and enrichment keep today's routes.

## M3 gates (lead ruling 6702cc; David authorized the merge, 10-21)

1. **Prep landed:**
- #23068: main b859b78, the ci-budget bump and the dead-code stub
removal;
   - review fixes #23082 and #23086;
- final main merges #23096 (main 34ce402) and #23133 (main 5406315).
2. **Staging tree equality:** `OMI_RELEASE_TREE` on all four `*-staging`
services equals `integration/legacy-retire^{tree}` at this head (see the
evidence section below).
3. **M2 review (GLM, which replaced Grok; ruling 43bd53):**
- CHANGES: 1 P1, fixed in #23082 (provider-STT outbox sweep plus
draining gates).
   - The 2 P2s are recorded below.
- The M1 blocker closure table is in
`data/run-2026-10-19-legacy-retire/review/M3/m1-blocker-closure.md`
(omi-workspace).
4. **Workflows:** all green on this head.
5. **Luna:**
   - Round 1: CHANGES, 2 majors, fixed in #23082.
- Round 2: 4 majors. Two lock fixes are in #23086 (Luna SHIP); two were
routed to dark-step gates.
   - Final-merge resolution: SHIP.

## Dark-step gates and follow-ups (none block M3; prod stays `on`)

- **`provider_stt_live`** (`DRAINING_PRECONDITIONS`): before leaving
`on`, prod needs:
  - the provider-stt queue;
  - the `PROVIDER_STT_TASKS_*` env;
  - the maintenance job;
- pagination or a due-cursor for the provider-STT outbox sweep (Luna
round 2 #4).
- **`legacy_final_pass_rehomed`** (`DRAINING_PRECONDITIONS`, lead ruling
b209a5): conversations still owned by `legacy_final_pass_v1` with no
live legacy job must be re-homed to batch first, and new final-pass
ownership must stop outside `on` (Luna round 2 #3). The
final-pass-rehome lane owns this.
- **GLM P2s:**
- the router's stranded-row 409 loop without `batch_adopts_stranded` is
lane 10 debt;
- BYOK uploads route to batch even with legacy sync `on` (David, 10-19).
This is a release-note item.

## `.github` changes in this PR and David's naming

Source of the naming: swarm-plan.md, lane 7: "B4 and B5 are named
.github changes (fourth round, #9)" (2026-10-19); the checkout-stall
bound (2026-10-20, main 1b07e5e); #22758 build-only mode; lead ruling
209335 (David named B7 and B8 items, 2026-10-21 ~06:05Z).

| File | Change | Named item |
| --- | --- | --- |
| `.github/workflows/config_train.yml` (new) | Config-train: plan/apply
of `backend/deploy/ops`, manual dispatch, prod-train lock;
workflow-level `GIT_HTTP_LOW_SPEED_*` | B4 (+ checkout-stall bound for
the two env lines) |
| `.github/actions/sync-backfill-lifecycle/action.yml` | Prod backfill
queue names come from the ops file; the train no longer reconciles the
prod queue (#22455, #22480) | B4 |
| `.github/workflows/gcp_backend.yml` | `break_glass_lock` input; prod
concurrency group `prod-train` | B5 |
| `.github/workflows/gcp_backend_listen_helm.yml` | same | B5 |
| `.github/workflows/gcp_backend_pusher.yml` | same | B5 |
| `.github/workflows/gcp_parakeet.yml` | same | B5 |
| `.github/workflows/gcp_llm_gateway.yml` | same (every prod deploy
writer shares the lock) | B5 |
| `.github/workflows/gcp_diarizer.yml` | B5 lock lines **plus** B7: OCI
revision/`omi.release.tree` image labels and a batch-worker
`image_digest` promotion path (verified by `check_release_tree.py`) |
B5; B7 (David, ruling 209335) |
| `.github/scripts/check-deployment-concurrency.py` | Guard that
evaluates the new prod-train group expressions | B5 |
| `.github/ci-budget.yaml` | config-train entry (B4); 1 run/day on the
six deploy workflows with `break_glass_lock` (B5); 1.1/day on three
build-only jobs (sync 11, #22758 base) | B4, B5, #22758 |
| `.github/checks-manifest.yaml` | Registers
`backend/scripts/check_release_tree.py` (the B7 promotion gate) | B7
(David, ruling 209335) |
| `.github/scripts/check_duplicate_routes.py` | Counts routers mounted
through `app_roles.mount_routers` (B8 OMI_ROLE map) as mounted | B8
(David, ruling 209335) |
| `.github/scripts/test_pre_push_ci_verified.py` | Test hygiene:
`clean_env` also pops `PRE_PUSH_BASE_BRANCH` and `OMI_PR_BODY_FILE`, so
lane pushes with a non-main base do not leak into the hermetic hook runs
| lead authority, ruling 66dba9 (edits an existing test script; no
workflow added) |
| `.github/scripts/dead_code/backend.allowlist.json` | The 7 swarm
contract-stub entries are removed (L01-4); every file now has importers
| allowlist hygiene (CI script data) |

| `.github/workflows/sync_ledger_fence_cutover.yml` | Prod takes the
`prod-train` lock, with a `break_glass_lock` input that falls back to
the backend stack lock (M3 Luna review) | B5, completing it on a file
that must share the backend mutation domain (lead ruling 5f60b3) |
| `.github/workflows/config_train.yml` (break-glass fallback) |
Break-glass shares `deploy-backend-stack-<env>` with `gcp_backend.yml`
(M3 Luna review) | B4/B5 (lead ruling 5f60b3) |

## Staging tree evidence

Verified 23:33-23:4xZ 10-21, on tier ro-dev:
- **Services:** all four `*-staging` services (`backend-staging`,
`backend-sync-staging`, `backend-sync-backfill-staging`,
`backend-integration-staging`) serve
`8d062ad3cfacf8b7eb26dea737a2969423548e64` at 100%.
- **Tree:** `OMI_RELEASE_TREE=5c398832bc4487066abbf2d49bcf8c6f9a700818`
== `8d062ad3^{tree}`.
- **Image:**
`us-central1-docker.pkg.dev/based-hardware-dev/staging/backend@sha256:18b8cf414566743aaee20bd2559695ec7b4536a75ec609fbc139f008bbf7ecf9`.
- **Batch worker:** `sha256:0954c71c87f5`, 0 replicas. Staging is plain
(no warm instances or overrides).
- **Deploy log:**
`data/run-2026-10-19-legacy-retire/lane01/m3/deploy-final2.log`
(omi-workspace).

## Product invariants affected

INV-DATA-1: integration carries lane 7's (#22430) edits to
`.github/workflows/gcp_*.yml`. They add the `prod-train`
concurrency/lock lines (B5) and, in `gcp_diarizer.yml`, the
worker-digest promotion. No Firebase or Firestore project, auth
authority or serving endpoint changes. Production-family artifacts stay
on `based-hardware`.

## Line-count exceptions

Line-Count-Exception: backend/routers/sync.py | 3881 -> 3966 | lane 10
legacy-dark fence wiring at the legacy call sites (#22495) plus the M3
review fixes (off-loop mode read, final-pass ACK); the file shrinks with
the C6/C11 deletions
Line-Count-Exception: backend/database/firestore_index_registry.py |
2196 -> 2200 | the legacy-dark zero-lost census index
(sync_content_ledger created_at, lost_recordings.py soak check 5)

## Failure class

Integration carries fix commits, and each declares its own class. For
this merge:

Failure-Class: none
UI-Evidence: none -- backend/CI retirement work plus sync merges; the UI
changes are main PRs that carried their own evidence

🤖 Generated with [Claude Code](https://claude.com/claude-code)
ZhaZhaBei pushed a commit to ZhaZhaBei/omi that referenced this pull request Oct 22, 2026
Main moved 16 commits past 34ce402 while BasedHardware#23096 ran CI; the only conflict was the
generated backend/docs/feature-flag-registry.md, re-rendered as of 2026-10-21
(check_feature_flag_registry.py passes). CI budget vs main and the label ratchet pass.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants