Repository navigation
feat(backend): infer transcript speaker labels from meeting notes - #20730
Git-on-my-level wants to merge 13 commits into
Conversation
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.
All reported issues were addressed across 17 files
You’re at about 98% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact [email protected].
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a52aad0311
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b92544d1e5
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f34ac9a94a
ℹ️ 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".
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…red read boundary Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Specialize rich participant extraction without an invariant mutable override, retain private evidence on canonical notes, and narrow validated source records. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Match complete explicit introductions, admit contextual labels within cited scopes, fence person creation and short aliases, and respect owner-resolution signals. Scope owner wording to body prose and retain non-owner pronouns. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Keep hyphenated and apostrophized name continuations when checking explicit introductions so their first token cannot authorize a shorter identity. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Preserve compound names and internal particles, decline ambiguous name spans, and share the full-name gate across roster creation and aliases. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Use public shared validation helpers in the summary scanner and migrate detector calls without changing their behavior. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Reject greetings and particle-led phrases after two name tokens, normalize apostrophes consistently, and require stronger CJK evidence for alias-only resolution. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…d wire emulator proof Review follow-ups (Cubic/Codex rounds on #20730): - Filter private _summary_speaker_candidates through the same corroboration result as visible participants in validate_rich_meeting_notes, so a contextual name removed from the note cannot stay eligible for identity writes; owner candidates stay roster-fenced at selection. - Move the assignment transaction's admission orchestration from database/ into utils/conversations/summary_speaker_labels (import hierarchy database -> utils); database/summary_speaker_labels keeps only lower-layer persistence helpers, all imports at module scope. - Fence labels to the note generation: persist a candidate/roster digest beside the note and decline on mismatch, so a stale reprocess generation sharing title/overview cannot apply older labels. - Compare the transcript fence against storage-canonicalized identity and honor a preserved user_title; canonicalize expected segments through canonicalize_segment_for_storage. - Clear summary_speaker_evidence whenever a non-summary identity writer (conversation_voice resolution) supersedes the inferred label. - Snapshot the pre-stage label projection for canonical L1 memory extraction so inferred labels cannot change memory attribution; refresh the people snapshot after inferred person creation. - Reject owner full-name variants of a first-name-only roster owner, ambiguous duplicate roster names, and bindings whose numeric key already carries an identity in a sibling scope; drop bindingless candidates before entitlement and catalog reads. - Strip summary_speaker_evidence from JSON-mode (API) serialization while retaining it for persistence; document the stage in listen_pusher_pipeline.mdx and clarify catalog-overflow semantics. - Wire summary_speaker_labels_emulator_test.py into run-emulator-proofs.sh so the transactional catalog-read/person-create proof runs in CI; fix its restore-reference NameError.
2ee672b to
475a2f8
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 475a2f84ad
ℹ️ 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".
|
Monitor run f2d4a2a8aa — addressed the outstanding Cubic/Codex review rounds on this PR (19 threads) in commit 475a2f8, rebased on current
CI on 475a2f8: all previously PR-failing generated-client/contract checks now pass after the rebase; the only remaining failures are the five known main-baseline tests (4× desktop TTS + 1× shared action items, #20748 evidence in that PR). PR-body line-count exceptions updated to the rebased counts. |
Address the Codex review round on the note-derived speaker-label stage: - Reject shortened variants of a fully named owner: a roster owner known as 'David Nguyen' now also declines a non-owner 'David' candidate (P1) — previously only the inverse direction (single-token owner to multi-token candidate) was guarded, so the owner's voice could bind to a catalog person sharing the owner's given name. - Never resurface dismissed people: rejection now checks is_dismissed=True (the real dismissal marker in database/person_aliases.py) alongside deleted, merged and AI-agent records (P2). - Keep the post-label people refresh inside the optional stage's fail-open try/except so a transient Firestore read cannot fail finalization of an already-persisted note (P2); source-invariant test pins the ordering. - Clear the note-generation digest when a generation has no candidates: the lifecycle write is merge=True, so an omitted key kept the obsolete fence and a stale worker could apply removed candidates; paths that never carried the private evidence still omit the key entirely (P2). - Strip summary_speaker_evidence from integration payloads: Python-mode Conversation dumps reached developer webhooks and installed apps with the private confidence/evidence receipt nested in segments (P1). - Hoist remaining function-local imports to module scope per backend/AGENTS.md import rules (P1); pc-fresh hermetic fixtures stub the module like every other sibling. Verification: test_summary_speaker_labels (105), redact_enrich (25), acceptance (31), free_tier_branch (44), finalize (55), entrypoint_matrix (174), import_isolation (10), audio_capture_candidate (11), trust_boundary (43), notes_call (1), rich_context (85) — each suite green; cross-suite co-selection pollution is pre-existing at HEAD and CI shards these files.
|
Monitor run 3208f56664 — addressed the six open Codex review threads in commit 5325e6f (fast-forward on
All six threads resolved after verification. Regression tests added for each fix (each red-proofed against the pre-fix code first). Targeted suites green: summary_speaker_labels (105), redact_enrich (25), acceptance (31), free_tier_branch (45), finalize (55), entrypoint_matrix (174), import_isolation (10), audio_capture_candidate (11), trust_boundary (43), notes_call (1), rich_context (85). Note: the three failing |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5325e6f16b
ℹ️ 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".
| linked = {e.person_id for e in named_entries if e.person_id} | ||
| if len(linked) > 1: | ||
| continue | ||
| if len(named_entries) > 1 and not linked: |
There was a problem hiding this comment.
Reject partially linked duplicate roster names
When two distinct roster entries share a display name but only one has a person_id, linked contains one value, so this condition admits the candidate and later forces every matching voice onto that linked person. The cited voice may belong to the unlinked attendee, corrupting transcript identity and person statistics. Fresh evidence in this revision is that the duplicate-name guard was added only for the all-unlinked case; require every duplicate entry to share the same non-null person ID before admitting it.
Useful? React with 👍 / 👎.
| restored_segments = conversation.transcript_segments | ||
| conversation.transcript_segments = segments_before_summary_labels |
There was a problem hiding this comment.
Pass a snapshot to memory extraction instead of swapping segments
When TRANSCRIPT_CHUNK_INDEXING_ENABLED is enabled and memory extraction runs eagerly, the chunk-indexing future is submitted immediately before this assignment. The executor can therefore read conversation.transcript_segments while it temporarily contains the pre-inference snapshot, making owner-attributed chunks nondeterministically render as generic speakers even though the persisted transcript has the inferred owner label. Avoid mutating the shared Conversation object while background tasks hold it; pass the snapshot directly to memory extraction or enqueue those tasks after restoration.
Useful? React with 👍 / 👎.
| # Snapshot the pre-stage label projection: inferred labels must not change | ||
| # what L1 memory extraction attributes (memory authority stays with capture | ||
| # and manual decisions), so the canonical path reads the snapshot instead. | ||
| segments_before_summary_labels = [segment.model_copy(deep=True) for segment in conversation.transcript_segments] |
There was a problem hiding this comment.
Gate the transcript deep copy behind the feature flag
This deep-copies every transcript after every successful finalization even when SUMMARY_SPEAKER_LABELS_ENABLED is off, which is the declared default. Long transcripts therefore incur an additional full object-graph allocation and copy on the normal production path solely for a disabled optional stage; create the snapshot only when the stage is enabled and its result may need to be excluded from memory attribution.
Useful? React with 👍 / 👎.
| speaker_match_source='summary_inferred', | ||
| summary_speaker_evidence={ | ||
| 'confidence': 'high', | ||
| 'evidence_segment_ids': list(speaker.evidence_segment_ids), |
There was a problem hiding this comment.
Invalidate inferred labels when their evidence is edited
When a user later edits a segment listed in evidence_segment_ids—for example, correcting “My name is Eddie Thai” to another name—the transcript edit transaction rewrites the text and invalidates structured-note references but leaves the summary-inferred person_id, is_user, match source, and this receipt intact. The inferred identity can therefore contradict its cited text permanently, and future summary passes will not repair it because select_candidates declines already-labeled clusters. Clear or re-evaluate the affected summary-inferred assignment when one of its evidence segments is edited.
Useful? React with 👍 / 👎.
|
Superseded by #20766. That PR keeps a name the notes model reads from screen text or a calendar attendee, stores a provisional person, and records the model's speaker binding as inferred. It does not land the admission scanner or SUMMARY_SPEAKER_LABELS_ENABLED. |
|
Hey @Git-on-my-level 👋 Thank you so much for taking the time to contribute to Omi! We truly appreciate you putting in the effort to submit this pull request. After careful review, we've decided not to merge this particular PR. Please don't take this personally — we genuinely try to merge as many contributions as possible, but sometimes we have to make tough calls based on:
Before your next PR, please skim:
If this was declined for direction or taste, maintainers should cite an invariant ID or open a proposed one — ask if that citation is missing. Your contribution is still valuable to us, and we'd love to see you contribute again in the future! If you'd like feedback on how to improve this PR or want to discuss alternative approaches, please don't hesitate to reach out. Thank you for being part of the Omi community! |
When a rich meeting note names a participant but the transcript still shows “Speaker 2”, the same notes response can now supply a high-confidence speaker mapping.
SUMMARY_SPEAKER_LABELS_ENABLEDdefaults off. The existing notes call returns bindings for participants and the owner; an optional transaction after note persistence applies supported mappings and creates strongly grounded people. No extra identity LLM call or client UI is added.Body prose about the owner remains in third person, naming the owner once per sentence (“David would welcome a meeting”), avoiding “David said David…” and “David said they…”. The owner's name stays forbidden in the title; non-owner people retain name-or-“they” wording and the gender-inference prohibition.
Authority and failure behavior
named_speaker_prompts_allowed: owner identification is free; other humans require paid eligibility. Manual endpoints retain their permissions.speaker_id_scope; only segments of that key in the cited scope are labeled. Other scopes reusing its number remain untouched. Independently evidenced scoped voices can reuse a number.full_real_namewith a stricter CJK minimum of three characters; a two-character CJK alias cannot resolve a longer stored name, while exact own-name matches remain eligible, including two-character stored names. Straight and curly apostrophes normalize identically. Catalog reads are bounded at 501 per transaction attempt; over 500 people declines named admission.is_useror main'sspeaker_identity_status=userelsewhere reserves the owner; main'snot_usersignal on the bound scope vetoes owner admission.no_matchis a failed acoustic match, not a confident non-owner signal. No new owner signal is invented.summary_inferredprovenance and evidence. Errors preserve the already saved note. Inferred identities never create teaching jobs or modify voiceprints; a model's “high” is not calibrated training authority. The existing manual teaching paths remain the way to authorize learning.person_id/is_userconsumers show the names. No deployment, flag flip, historical relabeling, or production-data read is included.Alternatives rejected: a second proposer/verifier call (extra context and latency), regex-only naming (misses meeting context), forced roster-to-voice bijections (mixed/silent attendees), teaching from inference (reusable voiceprint poisoning), and a new client surface. Open speaker PRs were checked, particularly #10954's separate resolver/verifier/teaching proposal and #20722's voice-match scoring lane; this builds on main and adds no dependency on either.
Cost measurement
The offline experiment runs the real prefix and notes builders/parser with synthetic responses and installed
o200k_basecache data read-only. No live model or customer transcript is used.This is several dozen output tokens per human (about 35 per additional participant), plus 380 constant input tokens. Revised wording adds 103 independently, including when identity is off (483 total input tokens when enabled). The feature adds no extra model call; the pre-existing bounded presentation-repair call is unchanged.
Current notes routing names OpenAI gpt-6-luna. Price source:
backend/llm_gateway/config/cost_rate_cards.yaml,openai.gpt-6-luna.2026-09-22: $0.10 input / $0.60 output per million uncached short-context tokens. The repository explicitly labels these provisional operator-directed rates, pending official published prices. Official list-price verification remains unverified because this lane is offline.At those rates, identity alone is $0.0848–$0.1478/1,000 conversations; both changes are $0.0951–$0.1581/1,000. Monthly formula:
N × (483 × input_price + completion_delta × output_price) / 1,000,000when all calls are enabled rich notes; separately account for the 103-token wording delta on disabled rich calls. The existing KB free-tier economics record (2026-09-21) reports 19,918 macOS events/30d as a volume proxy, not verified global eligible calls. Assuming all 19,918 were eligible gives $1.89–$3.15/month; an explicit 100,000-call assumption gives $9.51–$15.81/month. Actual eligible volume and participant mix were not read from production.These are authored fixture completion counts and a tokenizer proxy, not provider-billed usage. Cache/formatting/reasoning effects, Firestore reads/retries, and precision remain unmeasured. The card's provisional >272K input tier is $0.20/$0.90 and can reprice the whole request. Full inputs, formulas, reproduction, and dev qualification are in
backend/docs/summary-speaker-labels.md.Validation and rollout limits
The final suite includes 97 feature tests, 260 related notes/manual/task-capture tests, additional shared-detector/person-creation checks, and 3 offline cost probes. Nineteen regression cases failed before the admission/prompt correction; two additional compound-name cases failed before their boundary fix. Round 2 reproduced fifteen failing cases before correction, covering hidden later introductions, one-letter ASCII/curly apostrophe prefixes, name particles, padded/ambiguous spans, CJK roster creation, and CJK alias resolution without duplicates. A real-name decline control already passed before correction. Round 3 reproduced twelve failures before correction, covering padded affiliation/location spans, greetings and From/At variants, apostrophe normalization, and short CJK alias resolution. Tests prove padded spans leave both people and labels untouched, return
None, and preserve exact two-character stored-name matching. Latin spans now require capitals except internal particles; uncertain lowercase spans decline. The new free-plan owner-plus-guest test passed both before and after: it traps catalog reads and creates, proving the previously untested entitlement claim. Tests also cover full-introduction boundaries, creation authority, contextual exact-person attachment, scoped evidence, short aliases, main's owner signals, compressed transcript codecs, current-document/read-before-write semantics, manual decisions, stale/lifecycle fences, error isolation, note-copy/JSON boundaries, and absence of training authority. Final pass counts and type/preflight/push results are recorded in the lane report.StrictFirestoredoes not model transaction contention or commit retries; those behaviors were not exercised and are not claimed as covered. No real conversation, live endpoint, or released-client rendering was exercised. Before any production enablement, use a separately authorized devruntime_envoverlay, independently labeled consented recordings, and measure owner/person precision with confidence intervals, coverage, false creation, manual corrections, transaction failures, latency, and actual billed token deltas. Agree thresholds before looking at results and verify official price. No voiceprint teaching is enabled by this change.Product invariants
Failure-Class: none
The reviewed registry classes do not describe speaker-name proof, creation authority, or scope-qualified transcript labels. This lane forbids
.github/changes, so no new definition is added; the regression cases provide the concrete prevention surface.Line-Count-Exception: backend/utils/llm/conversation_processing.py | 1961 -> 1976 | Select the flagged extraction schema and retain private roster evidence at the existing notes-call seam; hoist the speaker-rules import to module scope. A broad orchestration refactor is outside this lane.
Line-Count-Exception: backend/utils/conversations/process_conversation.py | 3571 -> 3628 | Invoke the optional stage only after authoritative completed persistence; snapshot the pre-stage label projection for canonical memory extraction, stamp the note-generation digest, and refresh people after inferred creation. A broad orchestration refactor is outside this lane.
CI
The reported backend and generated-client failures also occur on the current
mainbase; this PR does not change the affected tests, API specs, or generated clients. Main run 37340248576 already fails the desktop TTS and TypeScript generator test files. The Desktop Backend Contracts workflow has nomainrun; its failing Swift check reports 479 generated methods versus 478 checked in. See.agent-briefs/laneB-ci-report.mdfor per-check evidence.🤖 Generated with Claude Code