Skip to content

fix: link and name authoritative batch speakers across uploads - #23581

Merged
Git-on-my-level merged 9 commits into
mainfrom
lane/qualfix
Oct 25, 2026
Merged

Git-on-my-level merged 9 commits into
mainfrom
lane/qualfix

Conversation

@Git-on-my-level

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

Copy link
Copy Markdown
Member

Design

Scope ruling: lead bus 846abb (2026-10-25 10:00Z) split this repair. This PR covers users with retained private-cloud audio and introduces no new retention. Bounded encrypted centroid storage for sync-off users requires David's separate privacy/retention decision and is tracked under the capture/transcription initiative.

Batch GPU units are short independent diarizations. Their local labels must not be treated as conversation identities; authoritative projection also currently bypasses naming. At enrichment, reuse the existing verified stored-audio Omi-v2 embedding extractor and encrypted per-conversation cache. Pool evidence by the original pyannote (unit scope, label), then perform bounded acoustic linking across units. Same-unit distinct labels cannot link (including transitively); an entire local label stays together. Missing evidence keeps the original anonymous group. Do not run ASR or a second full-conversation diarization.

After linking, run the existing calibrated centroid name matcher and joint owner arbitration against admitted owner/person voiceprints. Names label groups; a shared name never merges groups. A durable final:batch:conversation:<id> scope survives storage even when optional unit sidecars are dropped. Missing unit metadata makes the entire prior partition authoritative (prior groups stay whole and distinct); fresh uploads can still link to those groups. This conservative fallback can preserve an earlier over-split and emits a degraded-fallback event; it adds no retention or storage-budget exception. Preserve receipt speaker IDs, reserve manual owner voices, and reapply receipts before summarization and transactionally at persistence. Gaps never receive neighboring identities; existing work budgets and cache apply.

BATCH_CONVERSATION_SPEAKERS_ENABLED is a default-on kill switch, scoped by persisted authoritative batch provenance (the existing batch admission allowlist/cohort). Setting it false stops automatic batch linking/naming while preserving already stored and manual labels. No admission expansion, runtime flag flip, production reads/writes, backfill, or deploy is part of this PR. Lead rollout: existing cohort first; verify cross-unit grouping, enrolled owner/person attribution, abstentions, manual edits and enrichment latency before expanding the existing batch cohort. Deploy Cloud Run backend, backend-sync, backend-sync-backfill, backend-integration and Pusher (its finalizer shares this resolver); no GPU model change.

Validation

  • From backend/: BACKEND_PYTEST_WORKERS=4 BACKEND_UNIT_TEST_FILE_LIST=<newline-delimited selected-tests.txt> "$OMI_WORKSPACE_ROOT/bin/omi-heavy" run -- nice -n 19 bash test.sh: 438 passed across 12 selected files. Includes synthetic PCM for two voices across four short uploads; actual standard/enhanced database encode/decode of 300 segments; preservation against both splits and collapses after sidecar loss; fresh-unit linking; partial marker loss, naming, manual receipts/gaps, incompatible profiles, rollback and unchanged sync-off behavior.
  • From the product root: "$OMI_WORKSPACE_ROOT/bin/omi-heavy" run -- nice -n 19 bash backend/testing/e2e/run.sh -q --tb=short: 135 passed, 3 skipped, 2 xfailed at dfc48902feb7, before relocating the unchanged partition helper to the resolver inputs module. Targeted tests reran after relocation. Real backend boot/routes against hermetic service fakes.
  • backend/scripts/typecheck.sh with the worktree Python: zero errors.
  • Real-audio attribution qualification is a separate staging acceptance step. Existing private-cloud-audio consent/retention and embedding evidence requirements still apply; unavailable audio stays anonymous. No customer content was accessed for development or tests.
  • make preflight passed with the PR body supplied, including runtime image source closure and the product file-size ratchet (the resolver is smaller than its 1,564-line base).
  • Read-only Luna round 2: SHIP at 6659ee2c617aff145ef6df91fa24223caba4448f, no correctness findings in the delta (reviewer did not run tests). Production code is identical at final head 9706ee2a9f307cb01252373b5de95997e5587386; lead ruling 16eab1 accepts its test-only consolidation under the two-round cap. All persistence cases remain in the batch test module, preserving the earlier test-file inventory without changing budgets or workflows. GitHub checks own terminal CI state for the final head, including six backend unit shards and hermetic e2e. Lead owns merge and rollout. Sync-off evidence is explicitly outside this PR per the scope ruling above.

Failure-Class: new

Keep pyannote unit partitions while linking repeated voices across uploads,
then apply calibrated centroid naming and manual receipts. Recognize batch
upload clocks and retain provider/audio provenance for cached reprocessing.

Failure-Class: FC-unit-label-as-conversation-identity
Keep pyannote unit partitions while linking repeated voices across uploads,
then apply calibrated centroid naming and manual receipts. Recognize batch
upload clocks and retain provider/audio provenance for cached reprocessing.

Failure-Class: FC-unit-label-as-conversation-identity
Keep pyannote unit partitions while linking repeated voices across uploads,
then apply calibrated centroid naming and manual receipts. Recognize batch
upload clocks and retain provider/audio provenance for cached reprocessing.

Failure-Class: FC-unit-label-as-conversation-identity
Keep pyannote unit partitions while linking repeated voices across uploads,
then apply calibrated centroid naming and manual receipts. Recognize batch
upload clocks and retain provider/audio provenance for cached reprocessing.

Failure-Class: FC-unit-label-as-conversation-identity
Honor the lead's retained-audio scope ruling and prove sync-off does not
enter the new resolver, including gap participant accounting. Replace a
heterogeneous keyword dictionary with typed explicit resolver arguments.

Failure-Class: FC-unit-label-as-conversation-identity
Treat incompatible profile dimensions as missing identity evidence rather
than no_match, preserving established owner labels on cached reprocessing.
Cover both legacy and speaker-evidence serving projections.

Failure-Class: FC-unit-label-as-conversation-identity
@Git-on-my-level
Git-on-my-level marked this pull request as ready for review October 25, 2026 10:28
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 25, 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-25T12:05:14.371227Z 9706ee2 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.

@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: 89cab10333

ℹ️ 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".

owner_reserved = any(OWNER_IDENTITY in identities_of(cluster) for cluster in clusters)
if batch:
# Shared calibrated name policy, applied only after acoustic grouping.
from utils.conversations.final_pass_assignment import name_centroids

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 Extract the shared matcher to allow module-level imports

The new batch path imports name_centroids inside resolve_conversation_speakers, violating backend/AGENTS.md's explicit rule: “All imports at module top level — never inside functions.” Moving this import directly to the module header would create a circular dependency because final_pass_assignment.py already imports this module's vector helpers and threshold. Extract the shared matcher or its dependencies into a cycle-free module and import it at module scope.

AGENTS.md reference: backend/AGENTS.md:L165-L165

Useful? React with 👍 / 👎.

Comment on lines +3 to +6
Enrichment calls the existing stored-audio speaker resolver before summarization.
For transcripts with `final:batch:` provenance (including retained
`provider_speaker` scopes after resolution), `BATCH_CONVERSATION_SPEAKERS_ENABLED`
defaults on. The existing batch admission cohort determines which new records

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 Update the required speaker pipeline contract

This introduces default-on authoritative-batch linking and naming, including a new rollback switch, but the commit does not update backend/docs/listen_pusher_pipeline.mdx. backend/AGENTS.md explicitly requires that document to be updated “in the same PR” for speaker or transcription changes. Searching the pipeline document finds neither the new flag nor a reference to this runbook, leaving its processing contract without the new behavior and rollback control. Add the batch-resolution behavior and its scope there, linking this runbook for operational details.

AGENTS.md reference: backend/AGENTS.md:L161-L161

Useful? React with 👍 / 👎.

Keep a durable conversation batch scope and use the prior partition when
optional encrypted unit markers disappear. Preserve prior must/cannot links,
allow fresh uploads to join, and retain placement and receipt safety.

Cover real standard/enhanced storage roundtrips above the sidecar limit.
…alysis

Keep the authoritative input contract with receipt and measured-audio inputs.
Use a namespace prefix for the internal grouping key; no display label is built.
Retain every persistence case while restoring the backend test file inventory
of the previous green head. A new file shifted the sorted interleaved shard
layout; shard 3 passed assertions but exceeded its 720-second wall budget.

No production code, workflow, budget or check changes.
@Git-on-my-level

Copy link
Copy Markdown
Member Author

Ready for lead at 9706ee2a9f307cb01252373b5de95997e5587386.

  • CI: 64 terminal checks, zero pending/failed/cancelled, CLEAN/MERGEABLE. Backend unit suite and hermetic e2e completed successfully at that head.
  • Luna R2: SHIP at 6659ee2c617aff145ef6df91fa24223caba4448f; production code is identical. Lead ruling 16eab1 accepts the final test-only consolidation under the two-round cap. The persistence P1 is covered through real 300-segment standard/enhanced database roundtrips.
  • Local: 438 targeted cases across 12 files; e2e 135 passed, 3 skipped, 2 xfailed; zero type errors; all 37 preflight guards passed. All persistence cases retained, with no budget/workflow changes.

Lead owns merge; op1 deploys backend, backend-sync, backend-sync-backfill, backend-integration and Pusher. Existing admitted batch cohort plus retained private-cloud consent only; BATCH_CONVERSATION_SPEAKERS_ENABLED defaults on, with false as the kill switch across processing hosts. No merge, deploy, flag mutation, historical repair or production access was performed by this lane. Sync-off centroid retention remains a separate privacy/retention decision.

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