Repository navigation
feat(speakers): add a "Not a person" label that excludes media speakers from teaching and re-prompting - #21380
Git-on-my-level wants to merge 18 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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8cc63faa85
ℹ️ 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".
…he exclusion seam, and document the wire map - Bulk assign-bulk not_a_person now records the same ignored-voice marker (fenced by assignment generation) that the reject route and tag-prompt answers write, so live exclusions appear under Settings > Ignored Voices and can be restored from there. - listen_pusher_pipeline.mdx documents the speaker_assigned assign_type field and the bulk exclusion path per the backend wire-contract rule. - CaptureDependencies/CaptureProvider/composeCaptureProvider forward the excludeSpeaker seam so the production composition stays hermetically testable (C1 contract); composition tests pin the forwarding and the routed exclusion behavior.
8cc63fa to
f71ed4e
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f71ed4ed1f
ℹ️ 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".
…ubs resolve `import database.voice_profiles` fails in unit shards that stub the database package with an AutoMockModule (no submodule), while `from database import voice_profiles` resolves through the stub — the form every other router uses.
…e markers on positive assignment Address review threads on _assign_manual_speaker: - remove_ignored_voice now also drops generation-matched segment-scoped exclusion decisions, so restoring an ignored voice actually clears the manual decision that kept the speaker prompt-suppressed (thread 1). - A later person/user assignment clears the ignored-voice marker it supersedes via new clear_ignored_voices, so the voice leaves Settings > Ignored Voices and rejoins matching once reassigned (thread 2). - Router test drives the bulk path end-to-end; unit tests cover the segment-scoped restore and the superseding positive assignment.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 63a8167685
ℹ️ 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".
…evel fixtures Positive assignments now retire ignored-voice markers through voice_profiles.clear_ignored_voices; the match-scores and taught-persistence fixtures drove those routes without stubbing that module's Firestore client, so hermetic shards blocked on the GCP metadata server. Patch the client seam the same way test_speaker_rejections already does.
…e tests Speaker-scoped is_user assignments retire ignored-voice markers even when the assignment transaction is stubbed; keep that Firestore write hermetic.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: af6350fc53
ℹ️ 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".
…e newer assignments Address review threads on the live not-a-person exclusion: - record_ignored_voice now checks, inside the marker transaction, whether a newer whole-voice positive decision already won the receipt; stale-generation markers are not recorded, so a reassign during an in-flight exclusion cannot re-ignore the voice (segment_only range entries do not unseat it). - Positive reassignment only retires markers for speakers whose rejection no longer wins the receipt, so a range-only reassignment keeps the remaining whole-voice exclusion restorable from Settings > Ignored Voices. - Marker record/clear failures after the assignment transaction committed no longer 500 the endpoint: the decision is durable, the response stays authoritative, and the failure is logged for reconciliation. - The capture controller retires a local exclusion when the incremental socket path delivers a persisted manual positive label for that speaker (the receipt projects exclusions as unlabeled, never manual); automatic labels still cannot unseat a fresh exclusion.
|
Review round 6 — addressed the four open Codex threads on head
Verification: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 614fbf82ff
ℹ️ 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".
… writers, and surface degraded persistence Address review threads on the not-a-person exclusion loop: - clear_ignored_voices now takes assignment_generation and retains markers recorded by newer decisions, so a delayed clear from an older positive request can no longer remove a newer exclusion's marker (the voice would silently leave Settings > Ignored Voices). - Marker record/retire bookkeeping moves to utils/ignored_voice_markers.py shared by the live sheet router and tag-prompt card answers; a card Me/person answer now retires a prior live exclusion marker instead of leaving the positively assigned voice listed as ignored. - Both post-commit marker persistence handlers fail open with shared fallback telemetry (record_fallback, component=speaker_assignments) instead of log-only, per the backend fallback contract. - The conversations import in voice_profiles moves to module scope (database -> database edge verified cycle-safe). - The app's same-conversation refresh retires a local exclusion when the snapshot carries a newer manual positive label, mirroring the socket path. Verification: 384 backend tests across 12 affected suites; black clean; import-cycle smoke OK; 46 Dart tests across 4 suites; no desktop changelog entry required.
|
Review round 7 — addressed the five open Codex threads (fence, refresh, shared retirement, telemetry, import scope) on head |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6dc91b356f
ℹ️ 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".
…kers, and gate range-exclusion markers - Restore function-local database.conversations imports in voice_profiles: the module-level import broke test collection via the utils.speaker_identification import order (Backend unit shard 1/6). - record_ignored_voice now retains an existing marker whose assignment generation is newer than the write being recorded, so a delayed older exclusion cannot strand a newer exclusion's restore linkage (Codex P2). - record_exclusion_markers records a whole-voice marker only when the committed receipt has a winning whole-voice rejection at this write's generation; range (segment_only) exclusions no longer record markers that suppress segments outside the range (Codex P2). - Live capture keeps a WS manual-positive conflict excluded and reconciles via one coalesced authoritative in-progress snapshot instead of inferring ordering from label provenance, which the socket cannot order (Codex P2). - Tests: delayed-older-exclusion regression, range-exclusion no-marker, import-order probe, and reconcile-semantics rewrite of the WS retire test.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7d364c2d05
ℹ️ 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".
…econcile to capture session Review follow-up for the live 'Not a person' exclusion (Codex round): - Exclusions now record a monotonic decision epoch at acknowledgement and REST refreshes record the epoch at request start, so a same-conversation refresh whose request predates the exclusion acknowledgement can never retire it: only a refresh that started after the ack — and therefore saw the committed exclusion server-side — may retire it via a persisted manual positive. - The 300 ms exclusion reconcile is now bound to the capture lifetime and the active capture session: a stop/replace/dispose during the delay or the load cancels the install instead of mutating a later session. - ListenReceiver._handle_speaker_assigned clears the speaker-wide inference map (speaker_to_person, voice/segment identity status) for winning not_a_person rejections, so newly arriving segments of the rejected speaker are not relabeled from the stale map. Regression tests: stale-request fence, session-cancelled reconcile, and socket rejection clearing the speaker map.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 04276b4921
ℹ️ 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".
…esh conflicts, retire full matcher state and superseded markers Review follow-up round 2 (Codex): - The exclusion reconcile is now fenced by the CaptureSessionOwner token (per-recording identity) instead of activeCaptureSessionId, which the controller docs define as unchanged across sequential phone-mic stop/next-start; a recording roll mid-delay or mid-load cancels the install. A conflict arriving while a reconcile is in flight now queues one follow-up refresh instead of being discarded. - ListenReceiver._handle_speaker_assigned delegates the rejected voice's cleanup to the new SpeakerMatcher.retire_excluded_voice seam so the full matcher state retires (mapping origin, candidates, suggestions), letting a restored ignored voice match automatically again. - retire_exclusion_markers now distinguishes rejection kinds: only a still-winning not_a_person keeps its ignored-voice marker, so a newer not_me / not_person / unnamed card answer supersedes an earlier exclusion and clears the stale marker; the tag-prompt whole-voice branch calls the shared retirement for every answer. Regression tests: per-recording fence across a phone-mic restart, mid-refresh conflict queueing, full matcher-state retirement, and kind-distinguishing marker retirement.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3a3fdaca11
ℹ️ 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 round — addressed all open Codex review threads in two commits:
All 7 Codex threads from this monitor window are resolved. CI on |
…ected segment mappings, retire markers on not_me, harden reconcile fetch and wire Settings restoration - voice_profiles: the stale-generation fence now treats any newer whole-voice decision as superseding — not only positives — so a delayed not_a_person write cannot recreate a marker after a newer not_me/not_person answer. - receiver: a winning whole-voice rejection now also drops per-segment person mappings for every segment of the rejected speaker; a segment absent from the socket payload kept its stale mapping otherwise, and process_speaker_assigned_segments prefers segment_assignments. - conversations router: every non-exclusion assignment reconciles ignored-voice markers (assign_type=is_user&value=false commits a whole-voice not_me that previously skipped retirement via the elif person/user guard). - capture controller: the reconcile refresh uses getConversationsResult and skips installation when the fetch failed, instead of converting a transport failure into a destructive null install mid-capture. - capture/settings: restoring a voice from Settings > Ignored Voices now forwards to the live capture (onIgnoredVoiceRestored) — restoration writes no positive label, so no snapshot could ever satisfy the manual-positive retirement condition and the local exclusion would outlive the restore.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8b86d0c2f2
ℹ️ 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".
|
Codex review round 9 addressed — all five unresolved threads fixed in
Verification: backend runner green on the touched suites (speaker assignment, manual speaker assignments, ignored-voice markers, voice-profiles ignored voices, tag-prompt service, speaker rejections, live speaker carry, match scores — 179 passed total); Flutter |
A manual positive snapshot only retires the local exclusion when it carries whole-voice authority: the receipt's speaker entry projects onto every segment of the speaker. A range-only decision (segment_only / time_range) deliberately keeps the whole-voice not_a_person rejection authoritative outside the range — its in-range manual label must not drop the speaker-wide local exclusion while the server still considers the voice excluded. Retire per speaker only when the entire cluster in the snapshot carries the manual positive (and the refresh started after the exclusion's acknowledgement); otherwise keep blanking labels and suppressing suggestions. Update the reconcile tests to model whole-voice snapshots and add a range-only regression.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2068d318ad
ℹ️ 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 — addressed Codex thread "Preserve whole-voice exclusions across range-only labels" ( Fixed in 2068d31. Verified the report against backend semantics first: a range-only positive ( The fix retires the local exclusion per speaker only when the manual positive covers the speaker's entire cluster in the snapshot (a true whole-voice positive projects onto every segment of the speaker), keeping the request-epoch fence. Three reconcile tests whose snapshots had unknowingly modeled range-only shapes were corrected to whole-voice snapshots, and a range-only regression test was added. Verification: Also updated the |
…luded_speakers A selected-segment superseder (assign-bulk with explicit segment ids) retires the whole-voice not_a_person exclusion in the manual receipt, but only its segments project a manual label — a partial projection identical to a range-only (segment_only) label, which deliberately keeps the exclusion. The controller's whole-cluster-positive heuristic therefore re-blanked valid assignments and kept suppressing suggestions after the server had already retired the exclusion. Project the receipt's still-winning whole-voice not_a_person voices as 'excluded_speakers' on the Conversation payload (shared pure walker in models/speaker_exclusion.py; the receipt itself never serializes), and reconcile against it (epoch-fenced) with the projection heuristic kept only as the fallback for older servers. Strip the projection from the integration redactor, pin the field classification, regenerate the app-client spec and first-party clients, and document the wire map.
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
|
Monitor run — addressed Codex thread "Accept selected-segment superseders during reconciliation" ( Fixed in f76e5d1. Verified the report against backend semantics first:
Verification: 53 focused backend tests (new |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f76e5d14df
ℹ️ 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".
…t-route markers, stacked-generation restore, reconcile release window - excluded_speakers now projects [] whenever a manual receipt exists: a selected-segment superseder or cross-client restoration must read as an authoritative empty set, never null (null = old server heuristic that can never retire the exclusion). Doc updated to pin the contract. - The reject endpoint records/retires ignored-voice markers through the shared helpers (record_exclusion_markers / retire_exclusion_markers): not_me / not_person answers now retire a superseded exclusion marker, and a post-commit marker failure fails open with shared telemetry like every other writer. - Settings restore drops every not_a_person decision no newer than the marker's generation (stacked whole-voice + selected-segment exclusions); explicit not_me/not_person answers and genuinely newer decisions survive. - The exclusion reconcile completion frees the in-flight slot and schedules any queued follow-up synchronously before its first await, closing the release-window race that could strand a conflict's queued refresh. Verified: 139 backend tests (6 focused suites) and 14 capture tests pass; black and dart format clean.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5d464afd3b
ℹ️ 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".
| final receiptExcluded = _conversation?.excludedSpeakers; | ||
| for (final speakerId in List<int>.of(_excludedSpeakers)) { | ||
| if (startedAt <= (_excludedAtEpoch[speakerId] ?? 0)) continue; |
There was a problem hiding this comment.
Adopt exclusions present only in the server snapshot
When another client excludes a speaker in the same in-progress conversation, the refreshed snapshot contains that speaker in excludedSpeakers, but this loop iterates only the locally populated _excludedSpeakers set and never adds server-only entries. The controller therefore retains existing suggestions and accepts later socket labels for a voice the receipt authoritatively excludes; synchronize newly reported IDs into the local set and clear their labels/suggestions as well.
Useful? React with 👍 / 👎.
| if (!saved) return false; | ||
| if (_conversation?.id != conversationId || activeCaptureSessionId != sessionId) return true; | ||
| if (applyToSpeaker) { | ||
| _manualSpeakerDefaults[speakerId] = finalPersonId; | ||
| if (notAPerson) { | ||
| _excludedSpeakers.add(speakerId); |
There was a problem hiding this comment.
Reconcile newer assignments before installing the local exclusion
If this exclusion commits at generation N and another client commits a positive assignment at N+1 before the PATCH response reaches the app, that newer socket update can arrive while _excludedSpeakers is still empty and therefore schedules no reconciliation. This unconditional add then installs the older exclusion locally even though the server receipt is already positive, causing subsequent labels and suggestions to be blanked until an unrelated refresh; use the returned authoritative snapshot/generation before adding the exclusion.
Useful? React with 👍 / 👎.
|
Monitor run — addressed all four open Codex review threads on head
Verified: 139 backend tests across 6 focused suites (excluded-speakers projection, ignored-voice markers/restore, reject-route contract, rejections, assignment) and 14 capture tests pass; Note: |
|
@kodjima33 UI changes involving Git-on-my-level require your approval. Review the current diff, then comment |
There was a problem hiding this comment.
14 issues found across 47 files
Confidence score: 2/5
- Scope is lost in
conversation.py,receiver.py, andignored_voice_markers.py, so a reused speaker ID can exclude or restore the wrong voice. Carry the scope through exclusions, matching, and marker reconciliation. - In
speakers.py, an in-flight match can publish an old automatic label after the voice is retired. Add a voice-specific exclusion fence and clear any stale match state. conversation.pypersists the computedexcluded_speakersprojection, so a stale or null value can prevent it from being recomputed. Exclude this projection from ordinary persistence.- In
ignored_voices_sheet.dart, dismissing the sheet during a successful restore skips the capture callback, leaving the live speaker excluded. Notify the callback when restoration succeeds, even if the sheet has closed.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="app/test/widgets/name_speaker_sheet_test.dart">
<violation number="1" location="app/test/widgets/name_speaker_sheet_test.dart:94">
P3: This test does not verify the retry it claims to cover: the option can remain visible but be disabled after the first failure. Tap `option` again and assert `exclusions` reaches 2 so the test proves the failed path remains actionable.</violation>
</file>
<file name="backend/models/conversation.py">
<violation number="1" location="backend/models/conversation.py:517">
P1: `excluded_speakers` drops `speaker_id_scope`, so a reused numeric ID from another live or merged voice scope is indistinguishable. Return scope-qualified exclusions and make client matching use `(speaker_id_scope, speaker_id)`; otherwise marking one voice as “Not a person” can suppress labels and suggestions for an unrelated voice.
(Based on your team's feedback about scope-qualified speaker identity.) .</violation>
<violation number="2" location="backend/models/conversation.py:517">
P1: `excluded_speakers` is a computed response projection but is included in ordinary `Conversation.model_dump()` persistence. Persisting `null` or a stale list makes `_project_excluded_speakers` skip recomputation on the next read, so exclusions can disappear or remain stale after manual decisions. Strip this field from every storage payload, or otherwise distinguish persisted data from the wire projection.</violation>
</file>
<file name="backend/utils/ignored_voice_markers.py">
<violation number="1" location="backend/utils/ignored_voice_markers.py:55">
P2: These marker helpers discard `speaker_id_scope`, so a merged conversation that reuses a numeric speaker ID can ignore or restore the wrong voice cluster. Carry the scope through marker storage and reconciliation, or reject this marker path for scoped assignments instead of keying by the bare integer.</violation>
</file>
<file name="backend/routers/listen/receiver.py">
<violation number="1" location="backend/routers/listen/receiver.py:2097">
P1: This retirement applies a scoped exclusion to every live voice sharing the numeric speaker ID. Match the rejection scope against the matcher’s active scope and each segment’s scope before clearing state, otherwise excluding one merged source can suppress valid labels from another.
(Based on your team's feedback about scope-qualified speaker identity clusters.) .</violation>
</file>
<file name="backend/docs/listen_pusher_pipeline.mdx">
<violation number="1" location="backend/docs/listen_pusher_pipeline.mdx:1950">
P2: The sequence diagram still depicts every assignment, including `not_a_person`, validating and forwarding a speaker sample after this note. Make the sample-queue/forwarding steps conditional on an acknowledged person assignment, or add an explicit no-sample branch for `not_a_person`, so this protocol documentation does not contradict the implementation.</violation>
</file>
<file name="app/lib/services/capture/capture_composition.dart">
<violation number="1" location="app/lib/services/capture/capture_composition.dart:53">
P2: The new seam is optional, so any composed fixture that omits it silently reaches `_excludeMediaSpeaker`'s production HTTP fallback. Keep this composition's no-implicit-default contract by making `excludeSpeaker` required and non-nullable, then provide a strict fake in every `CaptureDependencies` fixture.</violation>
</file>
<file name="backend/tests/unit/test_speaker_labels_contract.py">
<violation number="1" location="backend/tests/unit/test_speaker_labels_contract.py:245">
P2: This test does not prove that marker persistence failed after being attempted: the response assertions are independent of `record_ignored_voice`, so a regression that skips the marker write still passes. Track the patched callable and assert it was invoked, then retain the 200 response assertion to verify fail-open behavior.</violation>
</file>
<file name="backend/routers/listen/speakers.py">
<violation number="1" location="backend/routers/listen/speakers.py:997">
P1: This retirement is not safe against an in-flight match: a stale receipt can resume after the exclusion, pass `_drop_reason`, and publish the old automatic label again. Add a voice-specific exclusion fence (and clear it only when a newer assignment supersedes the exclusion), or otherwise invalidate matching work before allowing publication.</violation>
</file>
<file name="app/lib/pages/settings/widgets/ignored_voices_sheet.dart">
<violation number="1" location="app/lib/pages/settings/widgets/ignored_voices_sheet.dart:68">
P1: Dismissing the sheet while the restore request is in flight skips `onRestored`, leaving the live capture’s speaker excluded even though the server restore succeeded. Notify the capture callback on successful restoration before the mounted guard, while keeping widget state updates behind that guard.</violation>
</file>
<file name="backend/tests/unit/test_manual_speaker_assignments.py">
<violation number="1" location="backend/tests/unit/test_manual_speaker_assignments.py:748">
P3: This test does not verify the stated preservation of assignments for another speaker: `unrelated` is absent from the transcript, so it only checks that an unknown key survives. Add a real transcript segment with a different `speaker_id` and assert its mapping remains after excluding speaker 4.</violation>
</file>
<file name="backend/tests/unit/test_voice_profiles_ignored_voices.py">
<violation number="1" location="backend/tests/unit/test_voice_profiles_ignored_voices.py:339">
P2: This subprocess regression test fails on Windows because it derives `cwd` by splitting only on `/tests/`. Normalize the path or derive the backend root with `pathlib` so the child process runs from the intended directory.</violation>
</file>
<file name="backend/models/speaker_exclusion.py">
<violation number="1" location="backend/models/speaker_exclusion.py:71">
P2: A malformed rejection value can make `Conversation` construction fail with `AttributeError` instead of ignoring the invalid decision. Guard the rejection value as a mapping before reading `kind`.</violation>
</file>
<file name="backend/utils/speaker_tag_prompts/service.py">
<violation number="1" location="backend/utils/speaker_tag_prompts/service.py:748">
P2: The `not_a_person` prompt path still writes markers directly after this shared retirement call, so a post-commit marker-store failure escapes `apply_answer` instead of failing open. Route this branch through `record_exclusion_markers` (or apply the same catch-and-fallback handling) so the committed answer remains successful and prompt bookkeeping still runs.</violation>
</file>
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
| # projection cannot distinguish a range-only label (the exclusion stands) | ||
| # from a selected-segment superseder (the exclusion is retired), but the | ||
| # receipt can. Null on conversations without any manual speaker decision. | ||
| excluded_speakers: Optional[List[int]] = None |
There was a problem hiding this comment.
P1: excluded_speakers drops speaker_id_scope, so a reused numeric ID from another live or merged voice scope is indistinguishable. Return scope-qualified exclusions and make client matching use (speaker_id_scope, speaker_id); otherwise marking one voice as “Not a person” can suppress labels and suggestions for an unrelated voice.
(Based on your team's feedback about scope-qualified speaker identity.) .
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At backend/models/conversation.py, line 517:
<comment>`excluded_speakers` drops `speaker_id_scope`, so a reused numeric ID from another live or merged voice scope is indistinguishable. Return scope-qualified exclusions and make client matching use `(speaker_id_scope, speaker_id)`; otherwise marking one voice as “Not a person” can suppress labels and suggestions for an unrelated voice.
(Based on your team's feedback about scope-qualified speaker identity.) .</comment>
<file context>
@@ -506,6 +507,31 @@ def _project_capture_coverage(cls, data):
+ # projection cannot distinguish a range-only label (the exclusion stands)
+ # from a selected-segment superseder (the exclusion is retired), but the
+ # receipt can. Null on conversations without any manual speaker decision.
+ excluded_speakers: Optional[List[int]] = None
+
+ @model_validator(mode='before')
</file context>
| # map after the exclusion, and process_speaker_assigned_segments falls | ||
| # back to speaker_to_person for segments without an explicit override. | ||
| rejected_speakers = manual_rejected_speakers(receipt) | ||
| for rejected in rejected_speakers: |
There was a problem hiding this comment.
P1: This retirement applies a scoped exclusion to every live voice sharing the numeric speaker ID. Match the rejection scope against the matcher’s active scope and each segment’s scope before clearing state, otherwise excluding one merged source can suppress valid labels from another.
(Based on your team's feedback about scope-qualified speaker identity clusters.) .
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At backend/routers/listen/receiver.py, line 2097:
<comment>This retirement applies a scoped exclusion to every live voice sharing the numeric speaker ID. Match the rejection scope against the matcher’s active scope and each segment’s scope before clearing state, otherwise excluding one merged source can suppress valid labels from another.
(Based on your team's feedback about scope-qualified speaker identity clusters.) .</comment>
<file context>
@@ -2088,6 +2088,35 @@ async def _handle_speaker_assigned(self, payload: Dict[str, Any]) -> None:
+ # map after the exclusion, and process_speaker_assigned_segments falls
+ # back to speaker_to_person for segments without an explicit override.
+ rejected_speakers = manual_rejected_speakers(receipt)
+ for rejected in rejected_speakers:
+ # Full matcher-state retirement via the shared retraction: popping
+ # speaker_to_person alone left _mapping_origin 'manual' behind, so
</file context>
| matches for a restored voice until the matcher resets at a | ||
| conversation boundary. | ||
| """ | ||
| self._retract_rejected_voice(voice, None) |
There was a problem hiding this comment.
P1: This retirement is not safe against an in-flight match: a stale receipt can resume after the exclusion, pass _drop_reason, and publish the old automatic label again. Add a voice-specific exclusion fence (and clear it only when a newer assignment supersedes the exclusion), or otherwise invalidate matching work before allowing publication.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At backend/routers/listen/speakers.py, line 997:
<comment>This retirement is not safe against an in-flight match: a stale receipt can resume after the exclusion, pass `_drop_reason`, and publish the old automatic label again. Add a voice-specific exclusion fence (and clear it only when a newer assignment supersedes the exclusion), or otherwise invalidate matching work before allowing publication.</comment>
<file context>
@@ -984,6 +984,18 @@ def _retract_rejected_voice(self, voice: int, segment_id: Optional[str]) -> None
+ matches for a restored voice until the matcher resets at a
+ conversation boundary.
+ """
+ self._retract_rejected_voice(voice, None)
+
def _manual_voice_decision(
</file context>
| if (!mounted) return; | ||
| setState(() => _restoring.remove(key)); | ||
| if (result is ApiSuccess) { | ||
| widget.onRestored?.call(voice.conversationId, voice.speakerId); |
There was a problem hiding this comment.
P1: Dismissing the sheet while the restore request is in flight skips onRestored, leaving the live capture’s speaker excluded even though the server restore succeeded. Notify the capture callback on successful restoration before the mounted guard, while keeping widget state updates behind that guard.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At app/lib/pages/settings/widgets/ignored_voices_sheet.dart, line 68:
<comment>Dismissing the sheet while the restore request is in flight skips `onRestored`, leaving the live capture’s speaker excluded even though the server restore succeeded. Notify the capture callback on successful restoration before the mounted guard, while keeping widget state updates behind that guard.</comment>
<file context>
@@ -63,6 +65,7 @@ class _IgnoredVoicesState extends State<_IgnoredVoices> {
if (!mounted) return;
setState(() => _restoring.remove(key));
if (result is ApiSuccess) {
+ widget.onRestored?.call(voice.conversationId, voice.speakerId);
OmiHaptics.success();
setState(() => _voices = _voices?.where((v) => v != voice).toList());
</file context>
| # projection cannot distinguish a range-only label (the exclusion stands) | ||
| # from a selected-segment superseder (the exclusion is retired), but the | ||
| # receipt can. Null on conversations without any manual speaker decision. | ||
| excluded_speakers: Optional[List[int]] = None |
There was a problem hiding this comment.
P1: excluded_speakers is a computed response projection but is included in ordinary Conversation.model_dump() persistence. Persisting null or a stale list makes _project_excluded_speakers skip recomputation on the next read, so exclusions can disappear or remain stale after manual decisions. Strip this field from every storage payload, or otherwise distinguish persisted data from the wire projection.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At backend/models/conversation.py, line 517:
<comment>`excluded_speakers` is a computed response projection but is included in ordinary `Conversation.model_dump()` persistence. Persisting `null` or a stale list makes `_project_excluded_speakers` skip recomputation on the next read, so exclusions can disappear or remain stale after manual decisions. Strip this field from every storage payload, or otherwise distinguish persisted data from the wire projection.</comment>
<file context>
@@ -506,6 +507,31 @@ def _project_capture_coverage(cls, data):
+ # projection cannot distinguish a range-only label (the exclusion stands)
+ # from a selected-segment superseder (the exclusion is retired), but the
+ # receipt can. Null on conversations without any manual speaker decision.
+ excluded_speakers: Optional[List[int]] = None
+
+ @model_validator(mode='before')
</file context>
| probe = 'import utils.speaker_identification; import database.voice_profiles; print("ok")' | ||
| result = subprocess.run( | ||
| [sys.executable, '-c', probe], | ||
| cwd=__file__.rsplit('/tests/', 1)[0], |
There was a problem hiding this comment.
P2: This subprocess regression test fails on Windows because it derives cwd by splitting only on /tests/. Normalize the path or derive the backend root with pathlib so the child process runs from the intended directory.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At backend/tests/unit/test_voice_profiles_ignored_voices.py, line 339:
<comment>This subprocess regression test fails on Windows because it derives `cwd` by splitting only on `/tests/`. Normalize the path or derive the backend root with `pathlib` so the child process runs from the intended directory.</comment>
<file context>
@@ -80,3 +80,266 @@ def test_restore_cannot_replace_a_newer_label_or_another_users_marker():
+ probe = 'import utils.speaker_identification; import database.voice_profiles; print("ok")'
+ result = subprocess.run(
+ [sys.executable, '-c', probe],
+ cwd=__file__.rsplit('/tests/', 1)[0],
+ capture_output=True,
+ text=True,
</file context>
| cwd=__file__.rsplit('/tests/', 1)[0], | |
| cwd=__file__.replace('\\', '/').rsplit('/tests/', 1)[0], |
| return sorted( | ||
| speaker_id | ||
| for speaker_id, decision in receipt_rejected_speakers(receipt).items() | ||
| if (decision.get('rejection') or {}).get('kind') == 'not_a_person' |
There was a problem hiding this comment.
P2: A malformed rejection value can make Conversation construction fail with AttributeError instead of ignoring the invalid decision. Guard the rejection value as a mapping before reading kind.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At backend/models/speaker_exclusion.py, line 71:
<comment>A malformed rejection value can make `Conversation` construction fail with `AttributeError` instead of ignoring the invalid decision. Guard the rejection value as a mapping before reading `kind`.</comment>
<file context>
@@ -0,0 +1,72 @@
+ return sorted(
+ speaker_id
+ for speaker_id, decision in receipt_rejected_speakers(receipt).items()
+ if (decision.get('rejection') or {}).get('kind') == 'not_a_person'
+ )
</file context>
| # so the ignored-voice marker must retire through the same shared | ||
| # reconciliation the live sheet uses (the router-only copy used to | ||
| # leave the positively assigned voice listed as ignored). | ||
| retire_exclusion_markers( |
There was a problem hiding this comment.
P2: The not_a_person prompt path still writes markers directly after this shared retirement call, so a post-commit marker-store failure escapes apply_answer instead of failing open. Route this branch through record_exclusion_markers (or apply the same catch-and-fallback handling) so the committed answer remains successful and prompt bookkeeping still runs.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At backend/utils/speaker_tag_prompts/service.py, line 748:
<comment>The `not_a_person` prompt path still writes markers directly after this shared retirement call, so a post-commit marker-store failure escapes `apply_answer` instead of failing open. Route this branch through `record_exclusion_markers` (or apply the same catch-and-fallback handling) so the committed answer remains successful and prompt bookkeeping still runs.</comment>
<file context>
@@ -740,6 +741,18 @@ def apply_answer(
+ # so the ignored-voice marker must retire through the same shared
+ # reconciliation the live sheet uses (the router-only copy used to
+ # leave the positively assigned voice listed as ignored).
+ retire_exclusion_markers(
+ uid,
+ conversation.get('id') or request.conversation_id,
</file context>
| }, | ||
| ); | ||
| final option = find.byKey(const Key('name_speaker_not_a_person')); | ||
| expect(option, findsOneWidget); |
There was a problem hiding this comment.
P3: This test does not verify the retry it claims to cover: the option can remain visible but be disabled after the first failure. Tap option again and assert exclusions reaches 2 so the test proves the failed path remains actionable.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At app/test/widgets/name_speaker_sheet_test.dart, line 94:
<comment>This test does not verify the retry it claims to cover: the option can remain visible but be disabled after the first failure. Tap `option` again and assert `exclusions` reaches 2 so the test proves the failed path remains actionable.</comment>
<file context>
@@ -73,6 +75,29 @@ void main() {
+ },
+ );
+ final option = find.byKey(const Key('name_speaker_not_a_person'));
+ expect(option, findsOneWidget);
+ await tester.tap(option);
+ await tester.pumpAndSettle();
</file context>
| expect(option, findsOneWidget); | |
| await tester.tap(option); | |
| await tester.pumpAndSettle(); | |
| expect(exclusions, 2); |
| matcher = _matcher_with_manual_mapping() | ||
| # s0 belongs to speaker 4 but is NOT in the payload below: its | ||
| # pre-existing per-segment mapping must still retire with the voice. | ||
| matcher.segment_assignments = {'s0': 'old', 'unrelated': 'keep'} |
There was a problem hiding this comment.
P3: This test does not verify the stated preservation of assignments for another speaker: unrelated is absent from the transcript, so it only checks that an unknown key survives. Add a real transcript segment with a different speaker_id and assert its mapping remains after excluding speaker 4.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At backend/tests/unit/test_manual_speaker_assignments.py, line 748:
<comment>This test does not verify the stated preservation of assignments for another speaker: `unrelated` is absent from the transcript, so it only checks that an unknown key survives. Add a real transcript segment with a different `speaker_id` and assert its mapping remains after excluding speaker 4.</comment>
<file context>
@@ -657,3 +657,113 @@ def test_merged_donor_range_selects_using_original_offsets(world):
+ matcher = _matcher_with_manual_mapping()
+ # s0 belongs to speaker 4 but is NOT in the payload below: its
+ # pre-existing per-segment mapping must still retire with the voice.
+ matcher.segment_assignments = {'s0': 'old', 'unrelated': 'keep'}
+ receiver = object.__new__(ListenReceiver)
+
</file context>
|
/approve-ui 5d464af |
|
David signed off this UI in Telegram on 2026-11-04. The CI check still needs kodjima33 to comment |
|
Folded into the survivor #24485 (head What carried over: the whole "Not a person" lane — backend exclusion model/markers/endpoints and voice-profile restore, the wire Ports required because main had refactored the area: the exclusion flow now delegates from main's |
|
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! |
Summary
feat: add a "Not a person" answer to speaker tagging for media audio (movies, TV, radio)
Today the speaker sheet only offers: assign to me, assign to an existing person, or type a new name. A user watching a movie has no honest answer, and dismissing the sheet leaves the cluster eligible for future prompts.
This adds an exclusion decision (not silence, not a person record, not negative training):
assign-bulkacceptsassign_type: 'not_a_person': segments resolve to unlabeled (is_user=false,person_id=null), the decision persists in the conversation's manual speaker assignments, and no voice sample extraction is ever scheduled for it.Product invariants affected
learning.assert_not_calledregression).Verification
origin/main(ab835c9b0bf229088b16c46b1f0617151c30bcfb) without conflicts; PR head is8cc63faa85af191046604a75605fab7e227121de. Reviewed speaker source and test files are unchanged by the merge.pytest backend/tests/test_speaker_assignment.py backend/tests/unit/test_speaker_assignment.py→ 16 passedflutter test test/services/capture/not_a_person_assignment_test.dart test/widgets/name_speaker_sheet_test.dart→ 18 passed (rerun after merging current origin/main)02a02384779d2939541678f876afbea1e714e4b7; 4 feature/fix commits. Round 3 review: SHIP; blocking stale-snapshot finding verified resolved. Coordinator rerun: 18 Flutter and 16 backend tests passed.f71ed4ed1fe1078b8c1d4f45f155bc66cceeafdb. Livenot_a_personnow records the ignored-voice marker (record_ignored_voice, generation-fenced) in the bulk assign route;listen_pusher_pipeline.mdxdocuments thespeaker_assignedassign_typewire field and the bulk exclusion path;CaptureDependencies/CaptureProvider/composeCaptureProviderforwardexcludeSpeakeras an optional seam (kept out of the frozen C1 spine oracles). Rerun after rework: 30 Flutter tests (composition/socket-generation/c1 spine suites) andtests/test_speaker_assignment.pygreen.UI-Evidence: none -- sheet gains one existing-style rejection button; no new screens
Line-Count-Exception: app/lib/services/capture/capture_controller.dart | 4239 -> 4479 | exclusion state is controller-resident; rounds 6-9 kept it cohesive (coalesced reconcile fenced by owner token, failed-fetch skip via getConversationsResult, Settings restoration signal onIgnoredVoiceRestored); receipt-authority reconcile via server excluded_speakers projection replaces the projection-only heuristic.
Line-Count-Exception: backend/routers/listen/receiver.py | 2448 -> 2477 | winning not_a_person receipt retires the speaker-wide map via retire_excluded_voice; round 9 also drops per-segment mappings (process_speaker_assigned_segments prefers segment_assignments).
Line-Count-Exception: backend/routers/listen/speakers.py | 1499 -> 1511 | one public seam (
retire_excluded_voice) delegating to the existing_retract_rejected_voiceretraction, so the socket receipt path retires the full matcher state without the receiver reaching into matcher internals.Line-Count-Exception: backend/routers/conversations.py | 2309 -> 2331 | assign_type branch plus teaching guard in the existing handler; logic lives in utils. Rounds 4/5/9: record + reconcile markers, incl. the whole-voice not_me path (is_user=false) the old person/user guard skipped.
Failure-Class: FC-read-in-flight-across-delete-resurrects-row
The fix commit (02a0238) repairs exactly this mechanism for speaker labels: a
conversation snapshot read issued before the "Not a person" mutation committed was
installed after it, resurrecting the excluded speaker's labels. Same fencing shape —
the install path now re-applies the authoritative local decision set — proven by the
new ordering regression (exclude → install stale snapshot → assert unlabeled).