Repository navigation
fix: link and name authoritative batch speakers across uploads - #23581
Conversation
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
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 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 |
There was a problem hiding this comment.
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 👍 / 👎.
| 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 |
There was a problem hiding this comment.
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.
|
Ready for lead at
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; |
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_ENABLEDis 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
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."$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 atdfc48902feb7, 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.shwith the worktree Python: zero errors.make preflightpassed 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).6659ee2c617aff145ef6df91fa24223caba4448f, no correctness findings in the delta (reviewer did not run tests). Production code is identical at final head9706ee2a9f307cb01252373b5de95997e5587386; lead ruling16eab1accepts 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