Skip to content

fix: preserve owner recognition across rollover and fragmented speech - #20964

Merged
Git-on-my-level merged 47 commits into
mainfrom
lane/owner-recognition-fix
Oct 8, 2026
Merged

Git-on-my-level merged 47 commits into
mainfrom
lane/owner-recognition-fix

Conversation

@Git-on-my-level

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

Copy link
Copy Markdown
Member

Owner recognition — revision of #20964

Revision in PR #20964, ready against main. Branch lane/owner-recognition-fix; this revision incorporates main a7127cc5648344ff62049af12f0d6775034a3fa4; correction commit 9a3b3df3c2, final merge head cd585daecd2566401db4e4d7039bc9a1a801d3be. The reviewed pre-fix remote head was 0bf95c84b0991eed101ab1673c77695b80ae9e55. Fresh final publication receipt follows below. No deployment, intentional production account request, api.omi.me call, historical relabeling, shared-checkout edit, or force push occurred. No production data was observed or retained. The interrupted unit run reached local SDK credential discovery; see the harness incident below.

Risks for the independent reviewer

  1. Mixed-image isolation: verify the new writer never touches the legacy cache filename, legacy fallback remains readable, and deletion/encryption/publication gates cover both objects. Old pusher cannot consume new short-evidence vectors. Its independently computed/legacy-cache identities remain its old behavior; this PR does not backport that policy into an unchanged image.
  2. Rollover concurrency: donor/current receipt/profile awaits, joint inter-voice arbitration, withdrawal of an already published automatic owner, and generation/provider-scope fences. Completed-roster ordinary rejection must remove the map and both delivered/persisted automatic owner labels. Manual, carried and channel identities must retain authority.
  3. Live budgets: 128 admitted voice ids, 12 attempts per voice, 256 per socket, all retained through rollover. Check serial lock retirement and evidence re-evaluation when an owner is taught after quota exhaustion. Exhaustion abstains; reconnect creates a new budget.
  4. Pusher capacity: two submitted/running batches process-wide, with slots released by the actual thread future rather than cancelled async waiters. Eligibility precedes eight-pass selection; snapshot reuse retains the revision CAS. This retry is best-effort, with no queue or hard network deadline.
  5. Partial placement: a distinct short bystander must remain unknown even beside owner speech in the same provider scope. All-unplaced audio, ambiguity, invalid windows, known holes and raced inventory still abstain/refuse.
  6. Profile costs: socket ceilings survive rollover; owner-only retries cannot reload paid people/entitlement. Enrollment repair remains consented enrollment audio with existing-vector/timestamp/account-deletion CAS.
  7. New repair counter: only a successful late CAS increments it. First-finalization metrics remain first-finalization snapshots. Metric failures cannot reverse a successful commit.
  8. Acoustic limits and E: synthetic control-flow tests do not establish real false-accept rates. Collapsed diarization/two voices within one segment, stale truthy owner vectors/model provenance, and free-desktop deterministic/custom-STT admission remain residuals.
  9. Harness incident: the interrupted run reached local ADC discovery through an unstubbed repair-state dependency. The final fixture stubs it and final runners explicitly disable ADC. No production data was observed or retained, but the earlier run’s complete credential/native-network behavior could not be established; see the incident clarification.

What this PR fixes

The accepted A/B/C/D/F changes retain an automatic owner across a same-provider-stream rollover, pool distinct short live fragments, resolve only verified placed portions of a completed conversation, retry identity after late audio, acquire the owner independently of paid-person naming, and bind short-fragment inheritance/automatic-only merge allocation to capture scope. Manual receipts and training authority remain separate.

The reviewer’s six blocking scenarios and four additional requirements are addressed in separate decision commits:

Finding Result
1 — carry bypasses arbitration Restore eligible evidence, recompute every current centroid against the completed print roster and jointly arbitrate current voices after all awaits; correct previously emitted automatic transcript labels and withdraw an earlier automatic mapping on contention or ordinary completed-roster rejection. Clear automatic live labels on ambiguous/no_match in both delivered and persisted transcripts, preserving manual/carried/channel authority. Current receipt, generation and scope fence publication. Only accepted validated automatic owner carry increments the existing rollover counter.
2 — short bystander inherits owner Remove temporal nearest-neighbor identity borrowing. An unembedded distinct provider voice without compatible scoped votes stays unknown, including in the full partial-placement stage.
3 — deque eviction starves decisions Calculate fresh-audio requirements from evidence that survives the next deque insertion. Noisy initial rejection can recover on later clean owner audio. Physical/distinct-audio/evidence floors are unchanged.
4 — short-fragment state grows Central admission bounds all automatic voice inventories. Rollover prunes idle locks and retires held/waited locks after their last user finishes; old generation work cannot publish. Prune obsolete automatic segment status entries.
5 — old pusher misuses new cache Write only the separate owner-evidence cache filename. Preserve v1 framing and legacy reads; never overwrite a legacy object. A behavioral test runs the new processing/writer and verbatim pre-PR reader/identity consumer, including reprocessing a cached unknown voice.
6 — continuous speech starves retry Check owner retry eligibility on normal dequeue as well as queue-idle paths.
7 — unbounded profile/repair polling At most eight failed acquisitions and seven owner-only retries per socket, with capped exponential backoff; at most three enrollment-audio repair attempts with separate backoff. Paid people/entitlement are loaded on conversation refresh, never owner retry.
8 — excessive live embedding calls At most 12 attempts per voice and 256 per socket, including failed calls. Counters survive rollover/profile refresh. A newly acquired owner can re-evaluate retained verified evidence without another model request.
9 — late candidate/capacity costs Scan at most 128 uploaded conversation ids, select at most eight eligible rows, use the selected snapshot for CAS, admit at most two batches process-wide, and cap each pass at 24 embedding attempts. Late passes do not repair enrollment audio. Cancelled waiters do not release slots while threads run.
10 — eventual recovery metric Add `omi_owner_identity_repair_total{outcome=owner_added

Automatic owner recognition remains plan-independent; automatic naming of other people remains paid; manual naming stays free. No model/threshold/plan-catalog/route/wire contract changed.

Mixed-image deployment and services

Production pusher stays on its current image for the coordinator’s stated unknown period. No prerequisite pusher deployment or rollout-order promise is required for cache safety. New Cloud Run/listen write audio/{uid}/{conversation_id}/speaker-embeddings.owner-evidence.v1.enc; old pusher reads only speaker-embeddings.v1.enc. New readers prefer the private policy cache and fall back to untouched legacy objects. Old writes cannot clobber the new object. Both remain encrypted by the owner key under the existing conversation/account deletion prefix; format v1 remains readable.

This isolates the new evidence policy from everything the old cache reader consumes. It does not claim the old image’s independent embedding/legacy-cache matcher now obeys the new evidence floor, or that an undeployed pusher performs C’s new partial/late repairs. Legacy mistakes and missed late repair remain possible in that image. There is no universal/end-to-end recovery claim.

Deploy listen for A/B/D and review fixes 1/3/4/6/7/8; Cloud Run backend, backend-sync, backend-sync-backfill and admitted integration/reprocessing consumers for shared C/D/F and cache safety. The pusher image contains partial/late processing, bounded disconnect admission and the late repair metric; these improvements wait until its deployment is possible. Separate Cloud Run desktop-backend release is needed for its admitted paid/API/reprocessing consumers; a backend-wide rollout does not reach it. No diarizer/model deployment, app code change, historical backfill or deployment was performed here.

Flags and production source intent

Values are checked-in production intent from backend/deploy/runtime_env/prod.overlay.yaml and the flag registry, not a live environment/image inspection:

Flag listen / pusher Cloud Run backend / sync / backfill
AUDIO_TIMELINE_SPANS true false (consumers)
LIVE_SPEAKER_SPAN_RESOLUTION true true
CAPTURE_EVIDENCE_V1_DARK_WRITE true true
SPEAKER_MATCH_SCORES_ENABLED true true
LIVE_CAPTURE_WINDOW_MERGE_UNION true false

AUDIO_TIMELINE_V2 stays default off. CONVERSATION_SPEAKER_RESOLUTION_ENABLED stays default true, with ordinary processing’s existing 45-second budget / 1,500 embedding-success limit; the late pass has its tighter 24-attempt / five-second advisory limits. No CONVERSATION_LIVE_SPEAKER_RESOLUTION_ENABLED gate is introduced. No new rollout flag is needed to isolate the cache writer. Existing span/incident-stop gates remain effective. Separate desktop-backend flags retain its existing default-off span behavior. COULD NOT DETERMINE actual running image revisions/live env values under the no-production-access fence.

Worst-case work per session-hour

These are source-derived logical document reads/request attempts, not production measurements or prices. Socket ceilings do not replenish each hour; an eight-hour socket gets the same ceiling as its first hour. Reconnects are new sockets and multiply these limits. Existing SDK/network retries are separate from logical gets; SDK timeouts are not an elapsed service guarantee.

  • D: seven owner-retry document reads + three repair-state reads + three two-document repair transactions + three lost-CAS owner rereads + at most seven retained-evidence receipt reads = 26 additional logical document reads per socket. Including all five Firestore transaction attempts (the installed SDK default) gives 50. Normal refresh contributes one owner read per eligible conversation (N), one entitlement/people load per conversation rather than per owner retry, and owner name resolution at most once per socket. Therefore D’s bounded added work is at most N + 26 logical owner-path reads, or N + 50 with those transaction retries, plus existing name/paid-person projection work. A continuously missing profile stops after eight failed acquisition reads; repair stays at three GCS/embedding attempts. Existing paid-person enrollment recovery is separate.
  • B: 12 embedding attempts per admitted voice, 256 overall per socket, including failures; plus at most three owner-enrollment repair embeddings from D. No ~2,800/hour unmatched-voice polling. Existing paid-person repair is separate. The ring remains 60 seconds; pending metadata is 128 voices × 128 intervals, not 128 total intervals.
  • A: at most two added reads per attempted carrying rollover: donor re-read and current manual receipt. Normal lifecycle reads are separate.
  • C: at most 128 candidate reads + 8 × 5 subsequent direct reads = 168 logical document reads per admitted disconnect batch with stored owner (receipt, owner, entitlement, transaction row and deletion marker); up to 232 if every late CAS uses all five transaction attempts. Paid people/projection adds up to eight existing queries/read sets. At most 8 × 24 = 192 embedding attempts, zero enrollment repairs, and at most two submitted/running batches per pusher process. Generation-pinned inventory allows at most 32 chunk downloads per pass (256 for eight); cache private/legacy lookup adds at most two reads per pass. Eligibility scanning is intentionally bounded at 128 rather than pretending skipped candidates cost nothing. Reconnect/retry re-admission can repeat this work; no durable per-conversation retry daemon is introduced.

The five-second late budget is advisory: model calls retain their timeout and storage/profile SDK operations can outlast it. Concurrency/attempt ceilings bound capacity; they do not prove a 40-second batch deadline.

C producer investigation and E residual

missing_source_position is selected in backend/utils/capture_evidence.py when no usable source-position run exists; listen’s transcript writer emits the unknown envelope. The missing producer claim is the app’s positioned capture frame/root/clock, delivered through the optional capture-evidence control message. Flutter’s compile-time CAPTURE_EVIDENCE_V1_DARK_WRITE defaults off; its send path falls back to raw payload when root, source-frame position or source-clock epoch is missing. The envelope cannot tell which app field was absent, whether a claim was rejected, or which installed build emitted it. Listen/pusher must not fabricate source positions.

Persisted audio_capture_start/end and verified manifest spans are separate placement evidence. The partial-stage regression resolves placed owner turns despite that exact unknown envelope and abstains on unplaced segments. COULD NOT DETERMINE whether the supplied six production conversations contain enough valid span audio; none were read. If their app build does not emit positioned frames, source-receipt recovery requires an app release. C’s verified partial placement helps independently.

E is excluded: free desktop’s deterministic minimum promises no managed call. Adding an acoustic pass there would change the managed-compute/free-desktop boundary. Free desktop/local projection and custom-STT budget exits can still retain an unmatched owner. No contract, paid access, local/BYOK admission or funding rule was changed.

Preserve / exclude rules

Manual receipts, rejection, segment ranges, locks, deletion and consent override automatic identity. Carry never creates manual/training authority. Only winning positive manual owner evidence can teach the voiceprint. Entitlement errors fail closed for paid non-owner candidates without hiding the owner; provisioning remains disabled. Speaker zero, unknown, no-match and ambiguous are not automatic owner labels. Desktop/phone/phone_call channel-authored identity stays untouched.

Reconnect/provider reconstruction starts a fresh scope; no integer-id carry across it. Preserve five-second live evidence, physical 0.5-second extraction floor, WAL’s separate one-second eligibility, all matching/grouping thresholds, v1 decode, generation-pinned reads, persistent-audio opt-out, access locks, 90% participant resolution and raw capture clocks. Automatic-only merge reallocates source ids and preserves absolute windows; manually authoritative merges retain ids and their existing full-receipt-transfer residual.

Excluded: new embedder/threshold calibration, intra-segment rediarization, simultaneous pendant/desktop source separation, prediction self-training, unbounded banks, generic queue/new worker, historical/account-specific relabeling, wholesale receipt migration, stored model provenance, public routes/schemas or ratified contract changes.

Main-owned Hygiene history

The earlier Windows dead-code failure came from main da6063f92b (#20946): SignVideo.tsx, signAssets.ts, signPoses.ts. It was reproduced under native TMPDIR/zsh and /tmp/bash with fixed PATH; the coordinator authorized continuation without fixing/allowlisting/skipping it. Main #20958 repaired it before the original push. This revision has no Windows changes and uses the normal hook without bypass. Current-main merges are included and verification below is fresh; prior c076 receipts do not prove this revision.

Product invariants affected

none — preflight’s affected-invariant selector requires none; free-desktop, plan entitlement, receipt/training, storage deletion and capture-clock rules above are preserved.

Failure class (fixes)

Failure-Class: FC-owner-display-name-source-drift

The existing class covers plan-independent usable owner acquisition/display-source authority. Item-specific behavioral regressions cover the additional failure mechanisms without editing the registry.

Line-Count-Exception: backend/utils/other/storage.py | 1987 -> 2015 | Keep the separate encrypted evidence-policy object on the existing owner storage write/encryption/deletion boundaries; legacy cache producer remains unchanged.

Line-Count-Exception: backend/routers/listen/transcripts.py | 1499 -> 1508 | Correct and withdraw automatic live identity at the transcript projection that consumes matcher decisions; preserve manual, carried and channel authority in delivery and persistence.

Verification and limits

Regression REDs reproduce the reviewer’s scenarios on the reviewed PR/pre-fix merged code, not fabricated API-absence assertions. The original accepted A/B/C/D/F REDs against main 3012ec5070 are retained below. Scenario fixes are in individual decision commits; no previously verified commit was amended. The old consumer behavioral test executes verbatim source from 3012ec5070, not an emulation with the new check disabled.

Backend tests run only through backend/test.sh / backend/scripts/run-unit-ci.sh, with credential variables scrubbed, ADC explicitly disabled for final runs, and the outbound-network guard. Final selected verification uses CI’s documented 1.0-second CPU guard. Early stricter local timing failures exposed imports inside a new test call; those dependencies now collect before timed test execution, with no guard-source change. All four CI shards passed again on final merge head cd585daecd2566401db4e4d7039bc9a1a801d3be using actual runner syntax --all --shard 4/K (total/index). No real-embedder, production replay, app/device render or deployed-image acceptance was run. Serialized transcript booleans/statuses are the changed backend output consumed by apps; this does not claim installed UI/acoustic acceptance.

GUARD CHANGED

No hook/check/runner/time-budget source or bypass changed. Existing fixtures now accept the existing retraction event keyword and added internal resolver keyword; exit-vocabulary assertions explicitly include capacity/budget reasons. Collector reload checks include the new metric. Previous safety assertions remain, including the in-flight same-lock serialization assertion. New retirement/state/eligibility/old-consumer tests strengthen coverage. Earlier accepted PR fixture/partial-placement/cache-duration assertion updates remain as described by that implementation; thresholds and unsafe-read refusals still run.

SCOPE ADDED

None. The coordinator explicitly required all ten revision items; bounded evidence re-evaluation preserves taught-owner recovery under the new quota.

SPEC DIVERGENCE

E remains excluded by the ratified managed-compute boundary. The new coordinator ruling explicitly requires old-reader-safe policy isolation, so new writes use a separate internal cache object while preserving v1 format and legacy readability. It also removes the unsafe nearest fallback even within a provider scope. No ratified route, stored conversation shape or vendor contract changed. The generated template’s claim that this product repo has no preflight/failure-class tools does not match this worktree; only this repo’s own requested preflight is used.

UI-Evidence: none -- backend identity change; no frontend/device session.

Revision RED proofs (verbatim assertion/runner excerpts)

Finding 1:

E       AssertionError: assert [True, True] == [False, False]
E       AssertionError: assert [True, True] == [False, False]
FAILED tests/unit/test_owner_recognition_rollover.py::test_carry_arbitrates_voice_matched_during_donor_read[asyncio]
FAILED tests/unit/test_owner_recognition_rollover.py::test_carry_arbitrates_voice_matched_during_donor_read[trio]
================== 2 failed, 12 passed, 13 warnings in 40.98s ==================
EXIT 1

Finding 2:

E       AssertionError: assert [True, True, True, False] == [True, True, False, False]
FAILED tests/unit/test_owner_recognition_placement.py::test_partial_pass_does_not_borrow_owner_for_distinct_short_voice
=================== 1 failed, 8 passed, 2 warnings in 10.65s ===================
EXIT 1

Finding 3/4:

E       AssertionError: assert False is not (False or False or False or False or False)
E        +  where False = TranscriptSegment(id='new', text='hi', speaker='SPEAKER_0', speaker_id=0, is_user=False, person_id=None, speaker_label_source=None, start=0.0, end=0.5, translations=[], speech_profile_processed=True, stt_provider=None, speaker_match_source=None, speaker_id_scope='conn-a:0', speaker_identity_status=<SpeakerIdentityStatus.unknown: 'unknown'>, audio_alignment=None, audio_capture_run=None, audio_capture_start=None, audio_capture_end=None, audio_source=None, voice_candidates=None, speaker_match_scores=None).is_user
E       AssertionError: assert False is not (False or False or False or False or False)
E        +  where False = TranscriptSegment(id='new', text='hi', speaker='SPEAKER_0', speaker_id=0, is_user=False, person_id=None, speaker_label_source=None, start=0.0, end=0.5, translations=[], speech_profile_processed=True, stt_provider=None, speaker_match_source=None, speaker_id_scope='conn-a:0', speaker_identity_status=<SpeakerIdentityStatus.unknown: 'unknown'>, audio_alignment=None, audio_capture_run=None, audio_capture_start=None, audio_capture_end=None, audio_source=None, voice_candidates=None, speaker_match_scores=None).is_user
FAILED tests/unit/test_owner_recognition_rollover.py::test_automatic_owner_rollover_transcript[asyncio-False-False-False-False-False]
FAILED tests/unit/test_owner_recognition_rollover.py::test_carry_arbitrates_voice_matched_during_donor_read[asyncio]
FAILED tests/unit/test_owner_recognition_rollover.py::test_automatic_owner_rollover_transcript[trio-False-False-False-False-False]
FAILED tests/unit/test_owner_recognition_rollover.py::test_carry_arbitrates_voice_matched_during_donor_read[trio]
================== 4 failed, 10 passed, 13 warnings in 32.07s ==================
E       AssertionError: assert None == ('user', 'User')
E        +  where None = <built-in method get of dict object at 0x120dc3c40>(1)
E        +    where <built-in method get of dict object at 0x120dc3c40> = {}.get
E        +      where {} = <routers.listen.speakers.SpeakerMatcher object at 0x120d9fe50>.speaker_to_person
E               assert 1000 <= 128
E                +  where 1000 = len({0: <asyncio.locks.Lock object at 0x120e65310 [unlocked]>, 1: <asyncio.locks.Lock object at 0x120e657d0 [unlocked]>, 2: <asyncio.locks.Lock object at 0x120e651d0 [unlocked]>, 3: <asyncio.locks.Lock object at 0x120e659d0 [unlocked]>, ...})
FAILED tests/unit/test_owner_recognition_limits.py::test_rejected_short_voice_can_recover_after_deque_eviction
FAILED tests/unit/test_owner_recognition_limits.py::test_short_only_voice_state_and_rollover_locks_are_bounded
======================= 2 failed, 13 warnings in 34.33s ========================
EXIT 1

Finding 5:

======================= 14 passed, 13 warnings in 30.62s =======================
E           assert not {0: Identity(is_user=True, person_id=None, anonymous_key=None)}
E            +  where {0: Identity(is_user=True, person_id=None, anonymous_key=None)} = SpeakerResolution(speaker_ids={'s0': 0}, significant_speaker_ids=[0], voice_identities={0: Identity(is_user=True, person_id=None, anonymous_key=None)}, embedded_segments=1, input_speaker_ids=1, coverage=1.0, stats={'voices': 1, 'eligible_segments': 1, 'owner_contended': 0}, match_scores=[], voice_identity_statuses={}).voice_identities
FAILED tests/unit/test_owner_recognition_mixed_cache.py::test_new_short_evidence_cache_is_invisible_to_old_pusher_on_reprocess
============================== 1 failed in 5.87s ===============================
EXIT 1

Finding 6/7:

E       AssertionError: assert [0] == [1]
E       AssertionError: assert 101 == 8
E        +  where 101 = <Mock id='4869014736'>.call_count
FAILED tests/unit/test_owner_recognition_profiles.py::test_continuous_queue_does_not_starve_overdue_owner_retry
FAILED tests/unit/test_owner_recognition_profiles.py::test_socket_owner_retries_and_audio_repair_have_total_ceilings
================== 2 failed, 6 passed, 13 warnings in 32.48s ===================
======================== 9 passed, 2 warnings in 9.04s =========================
EXIT 1

Finding 8/9:

======================= 7 passed, 13 warnings in 26.85s ========================
E       AssertionError: assert [] == ['c08', 'c09']
E         + []
E           AssertionError: assert 3 <= 2
FAILED tests/unit/test_owner_recognition_late_limits.py::test_late_candidates_are_selected_after_eligibility
FAILED tests/unit/test_owner_recognition_late_limits.py::test_process_admits_only_two_late_jobs_even_while_threads_block
======================= 2 failed, 13 warnings in 22.07s ========================
E       assert 36 <= 12
E        +  where 36 = len([1, 1, 1, 1, 1, 1, ...])
E       assert 20 == 16
E        +  where 20 = len([1, 1, 1, 1, 1, 1, ...])
FAILED tests/unit/test_owner_recognition_embedding_budget.py::test_unmatched_voice_has_twelve_embedding_attempts_per_socket
FAILED tests/unit/test_owner_recognition_embedding_budget.py::test_rollovers_cannot_reset_socket_embedding_budget
======================== 2 failed, 13 warnings in 6.57s ========================
EXIT 1

Finding 10:

E       AssertionError: assert [] == ['c08', 'c09']
E         + []
FAILED tests/unit/test_owner_recognition_late_limits.py::test_late_candidates_are_selected_after_eligibility
================== 1 failed, 1 passed, 13 warnings in 36.70s ===================
E       assert 0 == (0 + 1)
E        +  where 0 = <function test_late_identity_repair_counter_observes_only_committed_cas.<locals>.repair_count at 0x114f7c220>()
E        +  and   1 = int(True)
FAILED tests/unit/test_owner_recognition_placement.py::test_late_identity_repair_counter_observes_only_committed_cas[True]
=================== 1 failed, 10 passed, 2 warnings in 7.42s ===================
EXIT 1

Original accepted item proofs

Final-base red/green proofs

Main 3012ec5070af86b79ae28cc36716e744657bf872; HEAD c0768c71a7b96529f8e96ac9f219259bf3c22475. The iOS-only main merge left the backend tree unchanged, and proofs were rerun anyway.

CURRENT_CORE_PHASE=BASELINE
ITEM=A SELECTOR=tests/unit/test_owner_recognition_rollover.py
E       AssertionError: assert False is not (False or False or False or False or False)
E        +  where False = TranscriptSegment(id='new', text='hi', speaker='SPEAKER_0', speaker_id=0, is_user=False, person_id=None, speaker_label_source=None, start=0.0, end=0.5, translations=[], speech_profile_processed=True, stt_provider=None, speaker_match_source=None, speaker_id_scope='conn-a:0', speaker_identity_status=<SpeakerIdentityStatus.unknown: 'unknown'>, audio_alignment=None, audio_capture_run=None, audio_capture_start=None, audio_capture_end=None, audio_source=None, voice_candidates=None, speaker_match_scores=None).is_user
E       AssertionError: assert 1.0 == (0.0 + 0)
=================== 4 failed, 8 passed, 13 warnings in 6.20s ===================
SELECTOR_EXIT=1
ITEM=B SELECTOR=tests/unit/test_speaker_match.py
E       assert False is True
================== 1 failed, 42 passed, 13 warnings in 4.35s ===================
SELECTOR_EXIT=1
ITEM=C SELECTOR=tests/unit/test_owner_recognition_placement.py::test_partial_live_owner_with_unknown_client_source_receipt
E       AssertionError: assert [False, False, False, False] == [True, True, True, False]
E         
E         At index 0 diff: False != True
============================== 1 failed in 1.30s ===============================
SELECTOR_EXIT=1
ITEM=C SELECTOR=tests/unit/test_owner_recognition_placement.py::test_clipped_embedding_duration_is_the_owner_evidence_floor
E       AssertionError: assert not {0: Identity(is_user=True, person_id=None, anonymous_key=None)}
E        +  where {0: Identity(is_user=True, person_id=None, anonymous_key=None)} = SpeakerResolution(speaker_ids={'long': 0}, significant_speaker_ids=[0], voice_identities={0: Identity(is_user=True, person_id=None, anonymous_key=None)}, embedded_segments=1, input_speaker_ids=1, coverage=1.0, stats={'voices': 1, 'eligible_segments': 1, 'owner_contended': 0}, match_scores=[], voice_identity_statuses={}).voice_identities
============================== 1 failed in 1.14s ===============================
SELECTOR_EXIT=1
ITEM=D SELECTOR=tests/unit/test_owner_recognition_profiles.py::test_newly_taught_owner_is_loaded_despite_false_connection_latch
E       KeyError: 'user'
======================== 1 failed, 13 warnings in 4.78s ========================
SELECTOR_EXIT=1
ITEM=D SELECTOR=tests/unit/test_owner_recognition_profiles.py::test_sync_name_failure_retains_owner_and_denies_free_people
E       RuntimeError: synthetic ancillary failure
======================== 1 failed, 13 warnings in 3.68s ========================
SELECTOR_EXIT=1
ITEM=D SELECTOR=tests/unit/test_owner_recognition_profiles.py::test_resolution_failed_paid_people_read_retains_owner
E       RuntimeError: synthetic people failure
======================== 1 failed, 13 warnings in 4.71s ========================
SELECTOR_EXIT=1
ITEM=F SELECTOR=tests/unit/test_owner_recognition_scope.py::test_same_integer_id_in_two_scopes_cannot_label_other_short_reply
E       AssertionError: assert [True, False, True] == [True, False, False]
E         
E         At index 2 diff: True != False
============================== 1 failed in 2.52s ===============================
SELECTOR_EXIT=1
ITEM=F SELECTOR=tests/unit/test_owner_recognition_scope.py::test_manual_merge_reallocates_automatic_donor_voice_ids_and_preserves_capture_clock
E       assert 0 != 0
E       assert 0 != 0
============================== 2 failed in 3.04s ===============================
SELECTOR_EXIT=1
CURRENT_CORE_EXPECTATION=True
CURRENT_CORE_PHASE=BRANCH
ITEM=A SELECTOR=tests/unit/test_owner_recognition_rollover.py
======================= 12 passed, 13 warnings in 4.69s ========================
SELECTOR_EXIT=0
ITEM=B SELECTOR=tests/unit/test_speaker_match.py
======================= 43 passed, 13 warnings in 4.80s ========================
SELECTOR_EXIT=0
ITEM=C SELECTOR=tests/unit/test_owner_recognition_placement.py::test_partial_live_owner_with_unknown_client_source_receipt
============================== 1 passed in 1.46s ===============================
SELECTOR_EXIT=0
ITEM=C SELECTOR=tests/unit/test_owner_recognition_placement.py::test_clipped_embedding_duration_is_the_owner_evidence_floor
============================== 1 passed in 1.17s ===============================
SELECTOR_EXIT=0
ITEM=D SELECTOR=tests/unit/test_owner_recognition_profiles.py::test_newly_taught_owner_is_loaded_despite_false_connection_latch
======================== 1 passed, 13 warnings in 4.98s ========================
SELECTOR_EXIT=0
ITEM=D SELECTOR=tests/unit/test_owner_recognition_profiles.py::test_sync_name_failure_retains_owner_and_denies_free_people
======================== 1 passed, 13 warnings in 5.13s ========================
SELECTOR_EXIT=0
ITEM=D SELECTOR=tests/unit/test_owner_recognition_profiles.py::test_resolution_failed_paid_people_read_retains_owner
======================== 1 passed, 13 warnings in 5.52s ========================
SELECTOR_EXIT=0
ITEM=F SELECTOR=tests/unit/test_owner_recognition_scope.py::test_same_integer_id_in_two_scopes_cannot_label_other_short_reply
============================== 1 passed in 3.03s ===============================
SELECTOR_EXIT=0
ITEM=F SELECTOR=tests/unit/test_owner_recognition_scope.py::test_manual_merge_reallocates_automatic_donor_voice_ids_and_preserves_capture_clock
============================== 2 passed in 3.27s ===============================
SELECTOR_EXIT=0
CURRENT_CORE_EXPECTATION=True

Historical verification and harness clarification

The previous published head 0bf95c84b0991eed101ab1673c77695b80ae9e55 passed all four CI shards, the normal 34-check preflight and normal keepalive push. Those receipts do not verify this revision; fresh receipts follow below.

An earlier interrupted run reached gcloud config get project through an unstubbed owner-repair recovery-state dependency. COULD NOT DETERMINE whether it read a local credential file or all native-gRPC network behavior; no production data was observed or retained. The processes were terminated. The stage fixture now stubs that dependency, and all final runners scrub Google/Cloud SDK credential variables and explicitly set GOOGLE_APPLICATION_CREDENTIALS=/dev/null and CLOUDSDK_CONFIG=/dev/null. No credential payload was inspected or copied. An unchanged live-routing timing stall under concurrent heavy runs passed in the canonical isolated runner with one worker, TMPDIR=/tmp and fixed PATH; final shards run sequentially. An earlier normal push refused because fixed PATH omitted uv; adding the existing ~/.local/bin to PATH resolved it without changing/bypassing a hook.

The first new regression run used an incorrect strict-store setup: unconditional client-processing invalidation left a DELETE_FIELD sentinel in the fixture row. That setup failure was corrected using the existing live-write opt-out; it is not claimed as a defect RED. The genuine completed-roster and authority REDs below ran after that correction on merged pre-fix head d3509c3db5581860a99b665b54a5cc57ddaa2c65, before either product fix.

Completed-roster rejection revision

The re-review of 0bf95c84b0 found ordinary margin rejection kept an early automatic owner map and boolean. Publication now removes the automatic map/origin on every no-identity result and emits a retraction for a previously published segment. The empty-string carry sentinel remains distinct from malformed None; event validation/privacy behavior remains covered. Projection clears automatic live is_user and person_id on no_match as well as ambiguous, while preserving manual, carried and channel labels. No thresholds, budgets, cache formats, telemetry or contracts changed. This correction requires the listen image; no new pusher deployment prerequisite is introduced.

The full sequence uses the real selector/arbitrator, real live projection/writer, strict in-memory Firestore and real client delivery: old same-scope owner carry candidate → owner-only early peer accept → delivered and persisted owner → peer print arrives at 70 degrees → owner distance 0.200000 / peer 0.162568 → ordinary margin rejection → map/origin removed and delivered/persisted unknown with no person ID. A second variation explicitly removes the map before flushing to isolate the projection defect. Authority cases cover both owner and named-person labels, plus existing ambiguous withdrawal.

Completed-roster rejection RED — corrected strict-store setup

Command: bash backend/test.sh

Running 2 backend unit test file(s).
E           AssertionError: assert (True, True) == (False, False)
E             
E             At index 0 diff: True != False
E             
E             Full diff:
E               (
E             -     False,
E             -     False,...
E             
E             ...Full output truncated (3 lines hidden), use '-vv' to show
E           AssertionError: assert (True, True) == (False, False)
E             
E             At index 0 diff: True != False
E             
E             Full diff:
E               (
E             -     False,
E             -     False,...
E             
E             ...Full output truncated (3 lines hidden), use '-vv' to show
E           AssertionError: assert (True, True) == (False, False)
E             
E             At index 0 diff: True != False
E             
E             Full diff:
E               (
E             -     False,
E             -     False,...
E             
E             ...Full output truncated (3 lines hidden), use '-vv' to show
E           AssertionError: assert (True, True) == (False, False)
E             
E             At index 0 diff: True != False
E             
E             Full diff:
E               (
E             -     False,
E             -     False,...
E             
E             ...Full output truncated (3 lines hidden), use '-vv' to show
FAILED tests/unit/test_owner_recognition_rollover.py::test_completed_roster_margin_rejection_withdraws_delivered_and_persisted_owner[asyncio-False]
FAILED tests/unit/test_owner_recognition_rollover.py::test_completed_roster_margin_rejection_withdraws_delivered_and_persisted_owner[asyncio-True]
FAILED tests/unit/test_owner_recognition_rollover.py::test_completed_roster_margin_rejection_withdraws_delivered_and_persisted_owner[trio-False]
FAILED tests/unit/test_owner_recognition_rollover.py::test_completed_roster_margin_rejection_withdraws_delivered_and_persisted_owner[trio-True]
================== 4 failed, 16 passed, 13 warnings in 11.81s ==================
E       AssertionError: assert 'peer' == None
E       AssertionError: assert 'peer' == None
E       AssertionError: assert None == 'peer'
E       AssertionError: assert None == 'peer'
E       assert True is False
E       assert True is False
E       assert False is True
E       assert False is True
FAILED tests/unit/test_speaker_match.py::test_rejected_identity_projection_preserves_manual_and_channel_authority[False-auto-live_embedding-True-no_match]
FAILED tests/unit/test_speaker_match.py::test_rejected_identity_projection_preserves_manual_and_channel_authority[False-None-live_embedding-True-no_match]
FAILED tests/unit/test_speaker_match.py::test_rejected_identity_projection_preserves_manual_and_channel_authority[False-manual-live_embedding-False-ambiguous]
FAILED tests/unit/test_speaker_match.py::test_rejected_identity_projection_preserves_manual_and_channel_authority[False-carried-live_embedding-False-ambiguous]
FAILED tests/unit/test_speaker_match.py::test_rejected_identity_projection_preserves_manual_and_channel_authority[True-auto-live_embedding-True-no_match]
FAILED tests/unit/test_speaker_match.py::test_rejected_identity_projection_preserves_manual_and_channel_authority[True-None-live_embedding-True-no_match]
FAILED tests/unit/test_speaker_match.py::test_rejected_identity_projection_preserves_manual_and_channel_authority[True-manual-live_embedding-False-ambiguous]
FAILED tests/unit/test_speaker_match.py::test_rejected_identity_projection_preserves_manual_and_channel_authority[True-carried-live_embedding-False-ambiguous]
================== 8 failed, 65 passed, 13 warnings in 10.05s ==================
EXIT=1

Completed-roster rejection GREEN — touched matcher, projection and writer acceptance

Command: bash backend/test.sh

Running 5 backend unit test file(s).
======================= 20 passed, 13 warnings in 10.45s =======================
======================= 73 passed, 13 warnings in 9.10s ========================
======================== 6 passed, 13 warnings in 6.76s ========================
======================= 10 passed, 13 warnings in 38.47s =======================
======================= 37 passed, 13 warnings in 7.00s ========================
EXIT=0

Completed-roster rejection GREEN — final formatting and collection

Command: bash backend/test.sh

Running 2 backend unit test file(s).
======================= 20 passed, 13 warnings in 8.51s ========================
======================= 73 passed, 13 warnings in 6.89s ========================
EXIT=0

FINAL completed-roster correction CI shard 1/4 on 9a3b3df

Command: bash backend/scripts/run-unit-ci.sh --all --shard 4/1

0 errors, 14690 warnings, 0 informations 
Selected 417 backend unit test file(s) (shard 1/4: 417 of 1666 files): full backend unit suite
Running 417 backend unit test file(s).
COMPLETED_FILE_SUMMARIES=415
EXIT=0

FINAL completed-roster correction CI shard 2/4 on 9a3b3df

Command: bash backend/scripts/run-unit-ci.sh --all --shard 4/2

0 errors, 14690 warnings, 0 informations 
Selected 417 backend unit test file(s) (shard 2/4: 417 of 1666 files): full backend unit suite
Running 417 backend unit test file(s).
COMPLETED_FILE_SUMMARIES=413
EXIT=0

FINAL completed-roster correction CI shard 3/4 on 9a3b3df

Command: bash backend/scripts/run-unit-ci.sh --all --shard 4/3

0 errors, 14690 warnings, 0 informations 
Selected 416 backend unit test file(s) (shard 3/4: 416 of 1666 files): full backend unit suite
Running 416 backend unit test file(s).
COMPLETED_FILE_SUMMARIES=415
EXIT=0

FINAL completed-roster correction CI shard 4/4 on 9a3b3df

Command: bash backend/scripts/run-unit-ci.sh --all --shard 4/4

0 errors, 14690 warnings, 0 informations 
Selected 416 backend unit test file(s) (shard 4/4: 416 of 1666 files): full backend unit suite
Running 416 backend unit test file(s).
COMPLETED_FILE_SUMMARIES=415
EXIT=0

Pre-merge full suite (superseded after the main merge): all four canonical shards exited 0 on 9a3b3df3c22fbc9b2f30af531281eb1ee381f44d; type checking reported 0 errors on every shard (existing warnings remain). No source changed during the run. Touched acceptance suites also passed before the commit, with final formatted/collected matcher and rollover suites green.

Post-verification main merge and metadata snapshot

Main moved to a7127cc5648344ff62049af12f0d6775034a3fa4 (#20983 Review route enablement, #20985 mobile onboarding). Merged as cd585daecd2566401db4e4d7039bc9a1a801d3be; no owner fix was changed. All four shards on 9a3b3df3c2 passed, but are superseded for publication by a complete rerun on this merge head.

A metadata run started before the merge and later used its old fc4c1959278e base with the newly merged HEAD. It required INV-MEM-4 for main's runtime_env.yaml change, which is absent from this lane's final diff against current main. The run is an invalid mixed-snapshot verification, not acceptance or a trunk-red finding. Exact refusal: FAIL: PR touches locked product invariant paths but does not name the invariant ID(s). / Missing: INV-MEM-4 — 1 changed file(s) under 1 glob(s) / EXIT=1. Final metadata and normal preflight will rerun on the frozen merge head. No guard, invariant or runtime env was modified to address it.

POST-MERGE acceptance CI shard 1/4 on cd585da

Command: bash backend/scripts/run-unit-ci.sh --all --shard 4/1

0 errors, 14690 warnings, 0 informations 
Selected 417 backend unit test file(s) (shard 1/4: 417 of 1666 files): full backend unit suite
Running 417 backend unit test file(s).
COMPLETED_FILE_SUMMARIES=415
EXIT=0

POST-MERGE acceptance CI shard 2/4 on cd585da

Command: bash backend/scripts/run-unit-ci.sh --all --shard 4/2

0 errors, 14690 warnings, 0 informations 
Selected 417 backend unit test file(s) (shard 2/4: 417 of 1666 files): full backend unit suite
Running 417 backend unit test file(s).
COMPLETED_FILE_SUMMARIES=413
EXIT=0

POST-MERGE acceptance CI shard 3/4 on cd585da

Command: bash backend/scripts/run-unit-ci.sh --all --shard 4/3

0 errors, 14690 warnings, 0 informations 
Selected 416 backend unit test file(s) (shard 3/4: 416 of 1666 files): full backend unit suite
Running 416 backend unit test file(s).
COMPLETED_FILE_SUMMARIES=415
EXIT=0

POST-MERGE acceptance CI shard 4/4 on cd585da

Command: bash backend/scripts/run-unit-ci.sh --all --shard 4/4

0 errors, 14690 warnings, 0 informations 
Selected 416 backend unit test file(s) (shard 4/4: 416 of 1666 files): full backend unit suite
Running 416 backend unit test file(s).
COMPLETED_FILE_SUMMARIES=415
EXIT=0

Final acceptance: all four canonical backend shards exited 0 on cd585daecd2566401db4e4d7039bc9a1a801d3be, covering the full 1,666-file selector. Completed passing-file summaries: 415 / 413 / 415 / 415; excluded-marker/empty files explain the difference from selected counts. Every shard reported 0 type errors; existing warnings remain. Working tree is clean and no source changed during acceptance.

Frozen-head PR metadata/local validation

Command: scripts/pr-preflight --lane local --pr-body-file .agent-briefs/sol-impl/report.md

  SELECTED firestore-index-guard: #19941/#20113: undeclared serving queries fail in production; advisory Backend unit suite can be merged over. Run only the selector-owned hermetic guard so the exact offending main SHA cannot acquire Release Eligibility proof. @firestore-index-guard reuses the serving inventory and guard inputs instead of a second path list
  SELECTED product-file-line-count-ratchet: #9838 freezes oversized product files against the target branch without a shared metadata ledger; exact PR-body exceptions preserve reviewability without unrelated merge conflicts
======================= 28 passed, 13 warnings in 14.11s =======================
tests/unit/test_firestore_query_shapes.py::test_driver_has_no_errors[database.frame_requests.delete_expired_frame_request_metadata] PASSED [ 38%]
======================= 37 passed, 13 warnings in 10.82s =======================
====================== 432 passed, 13 warnings in 32.69s =======================
============================== 97 passed in 0.87s ==============================
============================= 50 passed in 12.66s ==============================
======================= 24 passed, 13 warnings in 21.97s =======================
============================== 37 passed in 0.73s ==============================
Firestore index guard passed (7 files; cold setup + tests 59.53s).
Diff hygiene checks passed.
Runtime-image contracts passed for 16 registered images.
Workflow contract checks passed.
OK: Pusher rollout quality gate passed.
Conversation lifecycle write guard passed.
Manifest checks passed: 34 check(s).
  SELECTED firestore-index-guard: #19941/#20113: undeclared serving queries fail in production; advisory Backend unit suite can be merged over. Run only the selector-owned hermetic guard so the exact offending main SHA cannot acquire Release Eligibility proof. @firestore-index-guard reuses the serving inventory and guard inputs instead of a second path list
  SELECTED product-file-line-count-ratchet: #9838 freezes oversized product files against the target branch without a shared metadata ledger; exact PR-body exceptions preserve reviewability without unrelated merge conflicts
PR metadata: /Volumes/Ephemeral/scratch/worktrees/omi/omi-lane-owner-recognition-fix-upstream-keep-clean/.agent-briefs/sol-impl/report.md, updated_at=local file
PR preflight passed: 34 checks in 197.50s.
EXIT=0

Frozen-head required make preflight

Command: make preflight

  SELECTED firestore-index-guard: #19941/#20113: undeclared serving queries fail in production; advisory Backend unit suite can be merged over. Run only the selector-owned hermetic guard so the exact offending main SHA cannot acquire Release Eligibility proof. @firestore-index-guard reuses the serving inventory and guard inputs instead of a second path list
  SELECTED product-file-line-count-ratchet: #9838 freezes oversized product files against the target branch without a shared metadata ledger; exact PR-body exceptions preserve reviewability without unrelated merge conflicts
======================= 28 passed, 13 warnings in 7.06s ========================
tests/unit/test_firestore_query_shapes.py::test_driver_has_no_errors[database.frame_requests.delete_expired_frame_request_metadata] PASSED [ 38%]
======================= 37 passed, 13 warnings in 7.51s ========================
====================== 432 passed, 13 warnings in 19.37s =======================
============================== 97 passed in 0.69s ==============================
======================= 24 passed, 13 warnings in 7.48s ========================
============================== 50 passed in 2.70s ==============================
============================== 37 passed in 0.09s ==============================
Firestore index guard passed (7 files; cold setup + tests 26.96s).
Diff hygiene checks passed.
Runtime-image contracts passed for 16 registered images.
Workflow contract checks passed.
OK: Pusher rollout quality gate passed.
Conversation lifecycle write guard passed.
Manifest checks passed: 34 check(s).
  SELECTED firestore-index-guard: #19941/#20113: undeclared serving queries fail in production; advisory Backend unit suite can be merged over. Run only the selector-owned hermetic guard so the exact offending main SHA cannot acquire Release Eligibility proof. @firestore-index-guard reuses the serving inventory and guard inputs instead of a second path list
  SELECTED product-file-line-count-ratchet: #9838 freezes oversized product files against the target branch without a shared metadata ledger; exact PR-body exceptions preserve reviewability without unrelated merge conflicts
PR metadata: /Volumes/Ephemeral/scratch/worktrees/omi/omi-lane-owner-recognition-fix-upstream-keep-clean/.agent-briefs/sol-impl/report.md, updated_at=local file
PR preflight passed: 34 checks in 175.40s.
EXIT=0

Final normal keepalive push — completed-roster correction

Command: git push origin lane/owner-recognition-fix

======================= 28 passed, 13 warnings in 9.63s ========================
tests/unit/test_firestore_query_shapes.py::test_driver_has_no_errors[database.frame_requests.delete_expired_frame_request_metadata] PASSED [ 38%]
======================= 37 passed, 13 warnings in 8.41s ========================
====================== 432 passed, 13 warnings in 23.65s =======================
============================== 97 passed in 0.59s ==============================
============================== 50 passed in 3.53s ==============================
======================= 24 passed, 13 warnings in 7.98s ========================
============================== 37 passed in 0.16s ==============================
Firestore index guard passed (7 files; cold setup + tests 32.02s).
Diff hygiene checks passed.
Runtime-image contracts passed for 16 registered images.
Workflow contract checks passed.
OK: Pusher rollout quality gate passed.
Conversation lifecycle write guard passed.
Manifest checks passed: 34 check(s).
PR metadata: /Volumes/Ephemeral/scratch/worktrees/omi/omi-lane-owner-recognition-fix-upstream-keep-clean/.agent-briefs/sol-impl/report.md, updated_at=local file
PR preflight passed: 34 checks in 155.39s.
Runtime-image contracts passed for 16 registered images.
  18 passed  8 warnings  0 failed  (26 checks)
============================== 22 passed in 2.31s ==============================
============================== 22 passed in 3.41s ==============================
======================== 11 passed, 2 warnings in 3.05s ========================
============================== 1 passed in 3.43s ===============================
============================== 60 passed in 4.44s ==============================
============================= 303 passed in 5.90s ==============================
============================== 4 passed in 6.61s ===============================
======================== 13 passed, 5 warnings in 4.29s ========================
======================== 46 passed, 5 warnings in 1.92s ========================
======================== 33 passed, 5 warnings in 4.98s ========================
======================= 2 passed, 13 warnings in 10.77s ========================
======================= 1 passed, 13 warnings in 10.61s ========================
======================= 25 passed, 8 warnings in 11.16s ========================
======================= 73 passed, 13 warnings in 11.15s =======================
======================= 5 passed, 13 warnings in 13.11s ========================
======================= 3 passed, 13 warnings in 13.70s ========================
======================= 7 passed, 13 warnings in 13.35s ========================
======================= 26 passed, 32 warnings in 12.48s =======================
======================= 5 passed, 13 warnings in 12.70s ========================
======================= 20 passed, 13 warnings in 13.48s =======================
======================= 1 passed, 13 warnings in 14.37s ========================
======================== 35 passed, 5 warnings in 4.00s ========================
====================== 106 passed, 50 warnings in 12.58s =======================
======================== 4 passed, 13 warnings in 7.88s ========================
====================== 119 passed, 13 warnings in 15.17s =======================
====================== 182 passed, 60 warnings in 13.51s =======================
======================= 43 passed, 13 warnings in 8.82s ========================
App-client OpenAPI compatibility passed against merge-base a7127cc5648344ff62049af12f0d6775034a3fa4.
Bounded pre-push gate passed; CI remains the full test authority.
   0bf95c84b0..cd585daecd  lane/owner-recognition-fix -> lane/owner-recognition-fix
EXIT=0

Final publication and handoff

Normal keepalive push exited 0 with OMI_PR_BODY_FILE set; no hook bypass or force push. git ls-remote verified the exact head:

cd585daecd2566401db4e4d7039bc9a1a801d3be	refs/heads/lane/owner-recognition-fix

PR #20964 remains ready against main. Final head cd585daecd2566401db4e4d7039bc9a1a801d3be; tested main baseline a7127cc5648344ff62049af12f0d6775034a3fa4. Both frozen metadata/local validation and required make preflight passed all 34 checks; the normal push hook passed its backend/type/image/compatibility/format gates. All four final-head backend shards passed. No deployment or CI follow-up performed; handed back for independent re-review.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 8, 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-08T13:02:09.712983Z c0768c7 PR opened
ℹ️ 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.

@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: c0768c71a7

ℹ️ 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 +295 to +297
vector = await run_blocking(
sync_executor,
load_owner_embedding,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Keep owner-profile recovery out of the sync executor

When a live session has legacy enrollment audio but no stored vector, load_owner_embedding performs a Firestore recovery-state read, a GCS existence check/download, file I/O, and a synchronous embedding request while occupying one of the 16 sync_executor workers. Concurrent listen sessions—especially with the new 30-second retries—can therefore exhaust the pool reserved for sync endpoint pipelines and stall WAL/sync processing. Keep orchestration async and dispatch the database, storage, and embedding steps to their designated executors rather than wrapping the entire recovery operation in sync_executor.

AGENTS.md reference: backend/AGENTS.md:L264-L272

Useful? React with 👍 / 👎.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

Failure-Class: FC-owner-display-name-source-drift

Reproduce owner-only early acceptance followed by completed-roster margin abstention at distances 0.200000 / 0.162568. Withdraw stale automatic maps and clear their delivered and persisted labels, preserving manual, carried and channel authority.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

…n-fix

# Conflicts:
#	backend/docs/listen_pusher_pipeline.mdx
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@Git-on-my-level
Git-on-my-level merged commit a02bee4 into main Oct 8, 2026
53 of 56 checks passed
@Git-on-my-level
Git-on-my-level deleted the lane/owner-recognition-fix branch October 8, 2026 20:07
Git-on-my-level added a commit that referenced this pull request Oct 9, 2026
…led PCM (#21047)

Follow-up to #20964 (merged a02bee4; deployed to production listen
2026-10-08 21:08Z). Long-lived pendant sockets exhaust the lifetime
embedding caps, and one unavailable pooled PCM interval aborts otherwise
usable speech.

Before measurements supplied with the incident (not independently
queried):

- `embedding_budget`: 106k exits in 11.9h (8.9k/h), over twice all live
decisions (~47k).
- 2026-10-09 06:00–08:00Z: 130 of 1,004 live sessions hit the budget;
budget exits were 25% of all speaker-ID log lines.
- `no_pcm`: 1.4/h → 1,280/h.
- Live owner pending decisions: 1,018/h → 1,199/h.

Replace lifetime socket exhaustion with a monotonic-wall-time token
bucket: initial/capacity 16, refill 240/3600 attempts per second (one
per 15 seconds). Attempts over t socket-hours are bounded by floor(16 +
240*t): ≤256 in the first hour and ≤240/hour asymptotically, at ≤10s
query PCM per attempt (≤2,560s first-hour and ≤2,400s/hour steady-state
query audio). An arbitrary one-hour window can use up to 256 including
saved burst credit. Idle credit caps at 16; failures spend tokens;
reservation precedes awaits. Conversation/profile churn and client audio
timestamps cannot mint tokens. Reconnection still creates a new socket
budget, as before; this is not an account-wide cap.

Keep 12 attempts per voice per conversation. Reset uncarried IDs on
rollover; carried manual mappings and validated automatic owner carry
retain their attempts. Profile refresh within the same conversation
preserves attempts. Accepted voices stop spending. All rejected voices,
including far/noisy rejections, retain fresh-audio recovery
opportunities within the 12-attempt allowance and socket bucket. Later
clean clips can evict noisy evidence and re-arbitrate owner claims,
withdrawing a competing automatic owner mapping. Failed one-second
reconnect evidence is also allowed to accumulate normal full-length
owner evidence. Retained evidence can still be re-arbitrated or
rechecked against a recovered owner without more model calls.

Skip unavailable PCM intervals; emit `no_pcm` only for an entirely
unusable pool and recheck actual remaining PCM duration. Metric names,
labels and exit reasons stay unchanged; the proposed `decided_voice`
reason and early stop were removed after the independent review. Merged
`origin/main` including #21052 (`5b42496d5c`) without rebasing or
rewriting the published branch. Its calibrated `[0.65, 0.70)` owner near
misses remain `unknown` / `pending`. Acceptance thresholds, margins,
carry eligibility and paid non-owner naming/free owner recognition are
unchanged.

Failure-Class: none
The existing classes do not cover permanent exhaustion of a
socket-scoped live embedding budget or aborting a pooled extraction on
one unavailable interval. The fix is implemented in the matcher
admission primitive with behavioral regression tests, rather than adding
a separate guard.

## Product invariants affected

none (as reported by `scripts/pr-preflight --lane local --suggest`).

## Validation

- Focused policy/budget/carry/pooling/exit assertions passed through
`backend/test.sh`, including #21052's pending-band tests. The revised
budget suite passed all 24 cases with the unchanged default 0.30s CPU
guard.
- Selected all 61 speaker/owner-recognition/owner-profile unit files
through `backend/test.sh`. All 1,491 cases passed their assertions. The
parallel run loaded the pre-optimization churn test and flagged its CPU
time; it also flagged unchanged mixed-cache and speaker-learning cases
at 0.34–0.60s. The final budget file passed the default 0.30s guard; the
two unchanged timing-offender files passed serially with the documented
CI 1.0s ceiling (50 cases). No timing policy or allowlist is changed in
this PR.
- `OMI_PR_BODY_FILE=/tmp/owner-budget-pr.md make preflight`: 31 checks
passed. PR-body metadata validation and required pre-push contracts also
run before publication. The failure-class history ratchet skips on the
shallow local clone.
- Regression tests execute real `SpeakerMatcher.match` and WAV encoding:
original far/noisy recovery, near-threshold recovery, competing
automatic owner withdrawal, and replay of the failed one-second
reconnect state described by #21051. #21051 is not merged into this
branch; the replay is not a composed reconnect implementation test.
- No Google credentials, production data or `api.omi.me` calls.

## Reviewer risks

- The smaller burst can delay a busy early conversation after 16
attempts; refill recovers one attempt every 15s. Long-lived sockets can
now spend recurring hourly cost, unlike the lifetime cap.
- Rejected voices can still exhaust their 12-attempt allowance before
later clean speech; the socket bound prevents conversation churn from
minting free budget. Review the far/noisy and near-threshold recovery
regressions and competing-owner withdrawal.
- Check carry-attempt accounting around profile/donor awaits, generation
fencing and owner contention. Existing carry and entitlement regression
tests remain part of validation.
- No production deployment or recognition-quality measurement is
performed by this PR.


<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/BasedHardware/omi/pull/21047?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/21047?returnTo=https%3A%2F%2Fgithub.com%2FBasedHardware%2Fomi%2Fpull%2F21047&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. -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant