Skip to content

feat(speakers): add a "Not a person" label that excludes media speakers from teaching and re-prompting - #21380

Closed
Git-on-my-level wants to merge 18 commits into
mainfrom
lane/speaker-not-a-person
Closed

Git-on-my-level wants to merge 18 commits into
mainfrom
lane/speaker-not-a-person

Conversation

@Git-on-my-level

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

Copy link
Copy Markdown
Member

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):

  • Sheet gains a "Not a person" action wired on both surfaces (live capture + conversation detail).
  • Backend assign-bulk accepts assign_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.
  • The live pipeline treats the cluster as manually decided: suggestions for that speaker stop, and auto-labels for that speaker no longer overwrite the decision. Assigning the same speaker to a person or to me later replaces the exclusion (reversible by design); repeating "Not a person" is an idempotent success.
  • Person-confidence evidence accounting does not count excluded segments as evidence for anyone.

Product invariants affected

  • INV-CAP-1: pendant audio retention — this change touches the capture controller only to add an exclusion call on an explicit user tap; it adds no power policy, socket close, unsubscribe, or frame-discarding path. Teaching consent note: no voice profile teaching happens without an explicit human decision, and "Not a person" never schedules sample extraction (learning.assert_not_called regression).

Verification

  • Merged current origin/main (ab835c9b0bf229088b16c46b1f0617151c30bcfb) without conflicts; PR head is 8cc63faa85af191046604a75605fab7e227121de. 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 passed
  • flutter 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)
  • Reviewed HEAD: 02a02384779d2939541678f876afbea1e714e4b7; 4 feature/fix commits. Round 3 review: SHIP; blocking stale-snapshot finding verified resolved. Coordinator rerun: 18 Flutter and 16 backend tests passed.
  • Review round 4 (Codex threads): head f71ed4ed1fe1078b8c1d4f45f155bc66cceeafdb. Live not_a_person now records the ignored-voice marker (record_ignored_voice, generation-fenced) in the bulk assign route; listen_pusher_pipeline.mdx documents the speaker_assigned assign_type wire field and the bulk exclusion path; CaptureDependencies/CaptureProvider/composeCaptureProvider forward excludeSpeaker as an optional seam (kept out of the frozen C1 spine oracles). Rerun after rework: 30 Flutter tests (composition/socket-generation/c1 spine suites) and tests/test_speaker_assignment.py green.

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_voice retraction, 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).

View guided diff Turn on auto-fix

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 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-15T02:50:10.642433Z 5d464af 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: 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".

Comment thread backend/routers/conversations.py Resolved
Git-on-my-level and others added 5 commits October 13, 2026 18:48
…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.

@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: 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".

Comment thread backend/routers/conversations.py Resolved
Comment thread backend/routers/conversations.py Resolved
…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.

@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: 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".

Comment thread backend/routers/conversations.py Resolved
Comment thread backend/routers/conversations.py Resolved
…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.

@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: 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".

Comment thread backend/routers/conversations.py Resolved
…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.
@Git-on-my-level

Copy link
Copy Markdown
Member Author

Review round 6 — addressed the four open Codex threads on head 614fbf82ff (full pre-push gate passed locally with a ≥3.10 interpreter; --no-verify not used):

  • Fence ignored markers against newer assignments — 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 an in-flight exclusion cannot re-ignore a voice reassigned by another client. Range-only (segment_only) entries do not unseat the exclusion.
  • Preserve markers for range-only reassignments — marker retirement now subtracts manual_rejected_speakers, so a range-only positive reassignment keeps the remaining whole-voice exclusion restorable from Settings > Ignored Voices.
  • Avoid reporting failure after committing the exclusion — post-commit marker record/clear failures no longer 500 the endpoint; the durable decision stays authoritative and the failure is logged (logger.exception) for reconciliation. Same discipline applied to the marker-clear path.
  • Reconcile newer server assignments before reapplying exclusions — 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); auto labels cannot retire a fresh exclusion. The full-refresh stale-snapshot protection is unchanged.

Verification: tests/test_speaker_assignment.py (3 passed) + tests/unit/test_voice_profiles_ignored_voices.py (8 passed) via BACKEND_UNIT_TEST_FILE_LIST bash test.sh; not_a_person_assignment_test.dart (3 passed) + capture_composition_test.dart (6 passed); dart analyze clean. PR body line-count exceptions updated to the new head sizes. The pre-existing Dart Analyze & Tests failures are the same 5-test set failing on unrelated PRs under the new full-suite workflow and are not introduced by this branch.

@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: 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".

Comment thread backend/database/voice_profiles.py Resolved
Comment thread backend/routers/conversations.py Resolved
Comment thread backend/routers/conversations.py Resolved
Comment thread backend/database/voice_profiles.py Resolved
… 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.
@Git-on-my-level

Copy link
Copy Markdown
Member Author

Review round 7 — addressed the five open Codex threads (fence, refresh, shared retirement, telemetry, import scope) on head 6dc91b356f.

@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: 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".

Comment thread backend/database/voice_profiles.py Resolved
Comment thread backend/routers/conversations.py Resolved
…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.

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

@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: 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".

Comment thread backend/routers/listen/receiver.py Resolved
…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.

@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: 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".

Comment thread backend/database/voice_profiles.py Resolved
Comment thread backend/routers/listen/receiver.py Resolved
Comment thread backend/routers/conversations.py Resolved
@Git-on-my-level

Copy link
Copy Markdown
Member Author

Monitor round — addressed all open Codex review threads in two commits:

  • 04276b4 — exclusion retirement fenced by decision epoch (a same-conversation refresh requested before the exclusion ack can no longer resurrect the retired label); the 300 ms exclusion reconcile bound to the capture lifetime and active session; ListenReceiver._handle_speaker_assigned clears the speaker-wide inference map for winning not_a_person receipts.
  • 3a3fdac — reconcile re-fenced by the per-recording CaptureSessionOwner token (per the controller contract, activeCaptureSessionId survives sequential phone-mic stop/restart and must not gate downstream semantic installs); conflicts arriving mid-refresh now queue one follow-up reconcile instead of being dropped; the rejected voice's matcher state retires fully via the new SpeakerMatcher.retire_excluded_voice seam (mapping origin, candidates, suggestions — so a restored ignored voice can match again); retire_exclusion_markers now distinguishes rejection kinds so a newer not_me/not_person/unnamed card answer clears a stale not_a_person ignored-voice marker.

All 7 Codex threads from this monitor window are resolved. CI on 3a3fdac is fully green (Dart, backend, Android Emulator Acceptance, Mobile Release Eligibility); merge state CLEAN.

…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.

@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: 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".

@Git-on-my-level

Copy link
Copy Markdown
Member Author

Codex review round 9 addressed — all five unresolved threads fixed in 8b86d0c2f2 and resolved.

Thread Fix
Fence marker writes against newer rejection kinds (voice_profiles.py) _newer_superseding_decision 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.
Clear every rejected voice's segment assignments (receiver.py) The rejection loop now drops per-segment person mappings for every by_id segment of the rejected speaker; process_speaker_assigned_segments prefers segment_assignments, so a segment absent from the socket payload kept its stale mapping otherwise.
Retire local exclusions after Settings restoration (capture_controller.dart) New onIgnoredVoiceRestored(conversationId, speakerId) signal wired from the Settings > Ignored Voices sheet — restoration writes no positive label, so no snapshot could ever satisfy the manual-positive retirement condition. Fenced by conversation id.
Retire markers for newer not-me assignments (conversations.py) Every non-exclusion assignment now reconciles ignored-voice markers (else: instead of elif person_id or is_user); assign_type=is_user&value=false commits a whole-voice not_me that previously skipped retirement.
Preserve capture state when reconciliation fetches fail (capture_controller.dart) The reconcile uses getConversationsResult and skips installation when ok is false — a transport failure no longer converts into a destructive null install mid-capture.

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 not_a_person_assignment_test (10 tests, incl. two new regressions) plus capture composition/provider suites green (110 tests); dart analyze clean on all changed files; PR-body line-count exceptions updated to the new totals. All CI checks pass on the new head.

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.

@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: 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".

@Git-on-my-level

Copy link
Copy Markdown
Member Author

Monitor run — addressed Codex thread "Preserve whole-voice exclusions across range-only labels" (capture_controller.dart)

Fixed in 2068d31. Verified the report against backend semantics first: a range-only positive (segment_only / time_range) does not unseat the whole-voice not_a_person rejection (manual_rejected_speakers skips segment_only entries), yet its in-range segments still project a manual positive label on read — so the old retirement condition (any single manual-positive segment) dropped the speaker-wide local exclusion while the server still excluded the voice.

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: not_a_person_assignment_test.dart 11/11; full capture suites (test/services/capture/ + capture_provider_test.dart) 407 passed / 14 skipped; name_speaker_sheet_test.dart 16/16; flutter analyze clean. CI on the new head: all checks completed, zero failures (CodeQL included). Thread resolved. The remaining DIRTY merge state is the pre-existing 156-commit base divergence, untouched by this fix.

Also updated the Line-Count-Exception for capture_controller.dart in the PR body to the exact new growth (4239 → 4465) to keep the ratchet's declared exception matching the diff.

…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.
@mintlify

mintlify Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
omi 🟢 Ready View Preview Oct 14, 2026, 10:43 PM

💡 Tip: Enable Automations to automatically generate PRs for you.

@Git-on-my-level

Copy link
Copy Markdown
Member Author

Monitor run — addressed Codex thread "Accept selected-segment superseders during reconciliation" (capture_controller.dart)

Fixed in f76e5d1. Verified the report against backend semantics first: manual_rejected_speakers treats a selected-segment bulk assign (non-segment_only) as a whole-voice superseder, so the server retires the exclusion while only the assigned segments project a manual label — a partial projection byte-identical to a range-only label, which keeps the exclusion. No segment-projection heuristic can distinguish the two, so this adds the receipt authority the thread asked for:

  • Conversation.excluded_speakers: server-authored projection of the manual receipt's still-winning whole-voice not_a_person voices, via a shared pure walker (models/speaker_exclusion.py) that manual_rejected_speakers now aliases — writers and the wire can never disagree. The receipt itself never serializes; the field is stripped from the integration redactor and pinned non-projection-family.
  • applyInProgressConversation reconciles against the projection (still epoch-fenced against pre-acknowledgement refreshes); the whole-cluster-positive heuristic remains only as the fallback for older servers without the field.
  • Wire plumbing regenerated: app-client OpenAPI spec (additive; verified absent from public/integration surfaces), Dart wire model, four first-party TS clients, and the macOS Swift DTOs. listen_pusher_pipeline.mdx documents the contract.

Verification: 53 focused backend tests (new test_conversation_excluded_speakers.py covering whole-voice projection, range-only retention, selected-segment superseder retirement, not_me supersession, malformed-receipt safety; trust-boundary pin; speaker-assignment suite) and 19 Dart capture tests (two new receipt-authority regressions) pass; dart analyze clean on touched files. Full pre-push gate green (72 checks; the Swift debug build was cut at the tool timeout during package fetch, after its DTO check passed).

@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: 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".

Comment thread backend/models/conversation.py Resolved
Comment thread backend/docs/listen_pusher_pipeline.mdx Resolved
Comment thread backend/database/voice_profiles.py Resolved
…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.

@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: 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".

Comment on lines +3587 to +3589
final receiptExcluded = _conversation?.excludedSpeakers;
for (final speakerId in List<int>.of(_excludedSpeakers)) {
if (startedAt <= (_excludedAtEpoch[speakerId] ?? 0)) continue;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Comment on lines 4114 to +4117
if (!saved) return false;
if (_conversation?.id != conversationId || activeCaptureSessionId != sessionId) return true;
if (applyToSpeaker) {
_manualSpeakerDefaults[speakerId] = finalPersonId;
if (notAPerson) {
_excludedSpeakers.add(speakerId);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

@Git-on-my-level

Copy link
Copy Markdown
Member Author

Monitor run — addressed all four open Codex review threads on head 5d464afd3b (context ec28ea8bef):

Thread Fix
Emit an authoritative empty exclusion projection (models/conversation.py) excluded_speakers now projects [] whenever a manual receipt exists — a selected-segment superseder or cross-client restoration reads as an authoritative empty set, never null (null = old-server heuristic that could never retire the exclusion). Wire contract documented in listen_pusher_pipeline.mdx.
Route reject-endpoint markers through the shared helpers (routers/speaker_labels.py) The reject route now records/retires via record_exclusion_markers/retire_exclusion_markers like the live sheet and card answers: not_me/not_person answers retire a superseded exclusion marker, and a post-commit marker failure fails open with shared fallback telemetry.
Remove older exclusions when restoring a voice (database/voice_profiles.py) Settings restore now 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.
Preserve reconcile requests arriving during release (capture_controller.dart) The 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 across 6 focused suites (excluded-speakers projection, ignored-voice markers/restore, reject-route contract, rejections, assignment) and 14 capture tests pass; black, dart format, and swiftc -parse on the regenerated desktop DTO clean. The pre-push gate passed with the desktop Swift compile skipped via its own hatch — this worktree could not fetch Sparkle/onnxruntime/Sentry binary artifacts (95% disk); CI compiles the full package (all 9 checks green on this head).

Note: mergeStateStatus remains DIRTY against main — pre-existing before this round, separate from these threads.

@Git-on-my-level
Git-on-my-level marked this pull request as draft November 4, 2026 07:01
@Git-on-my-level
Git-on-my-level marked this pull request as ready for review November 4, 2026 07:27
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

@kodjima33 UI changes involving Git-on-my-level require your approval. Review the current diff, then comment /approve-ui 5d464afd3bd7fc7eee2735a5c5b82796dfccae42. Each new head needs a fresh approval. To withdraw it, comment /reject-ui <full head SHA>. Non-UI work and unrelated access are unaffected.

@cubic-dev-ai cubic-dev-ai 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.

14 issues found across 47 files

Confidence score: 2/5

  • Scope is lost in conversation.py, receiver.py, and ignored_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.py persists the computed excluded_speakers projection, 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

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: 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.) .

View Feedback

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:

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: 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.) .

View Feedback

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)

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: 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);

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

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: 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],

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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>
Suggested change
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'

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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(

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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>
Suggested change
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'}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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>

@kodjima33

Copy link
Copy Markdown
Collaborator

/approve-ui 5d464af

@Git-on-my-level

Copy link
Copy Markdown
Member Author

David signed off this UI in Telegram on 2026-11-04. The CI check still needs kodjima33 to comment /approve-ui 5d464afd3bd7fc7eee2735a5c5b82796dfccae42 on this head.

@Git-on-my-level

Copy link
Copy Markdown
Member Author

Folded into the survivor #24485 (head d6ab3673d9e40b3612856348e40704f7663501d6, branch lane/action-reminders-1103) and closed in its favor — nothing merged to main from here.

What carried over: the whole "Not a person" lane — backend exclusion model/markers/endpoints and voice-profile restore, the wire excluded_speakers projection, the sheet affordance and its locale strings, and all 14 tests of not_a_person_assignment_test.dart. The deleted conversation_capturing/page.dart call site was ported to its Episodes-v1 replacement (live_transcript_view.dart).

Ports required because main had refactored the area: the exclusion flow now delegates from main's CaptureSpeakerAssignment mixin (assignSpeakerToConversation(notAPerson:) → the controller-owned excludeSpeakerFromConversation), the epoch-fenced retirement runs in applyInProgressConversation, live segments of excluded speakers are re-blanked in the snapshot part file, and the exclusion reconcile refresh is scheduled from the new _processNewSegmentReceived location. safe_mode-style care was not needed here — no firmware files were touched.

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

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:

  • Project standards — Ensuring consistency across the codebase
  • User needs — Making sure changes align with what our users need
  • Code best practices — Maintaining code quality and maintainability
  • Project direction — Keeping aligned with our product principles and locked invariants

Before your next PR, please skim:

  • PRODUCT.md — product north star
  • Product invariants — locked rules (shared chat, memory tiers, agent control plane, integrations, brand)

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!

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.

2 participants