8000 fix(speakers): never match a voice to someone it was said not to be by adeelahmad · Pull Request #691 · adeelahmad/lense · GitHub
[go: up one dir, main page]

Skip to content

fix(speakers): never match a voice to someone it was said not to be - #691

Merged
adeelahmad merged 1 commit into
mainfrom
claude/project-thread-xfmkzn
Oct 19, 2026
Merged

adeelahmad merged 1 commit into
mainfrom
claude/project-thread-xfmkzn

Conversation

@adeelahmad
Copy link
Copy Markdown
Owner

Requested by Adeel · project thread

Description

Before: after a voice was split off from a person ("Not them here") or a suggested pair was marked not the same, a voice in a new or re-diarized asset that sat near the first person's average could still be auto-assigned or suggested as them. The voice matcher's match() ignored not_same.

After: for each pair of people said not to be the same, a new voice goes to, or is suggested as, only the one of the two it sounds more like, by their voice overall or in any one asset they're in. When two voices in one recording are both nearest the same person, the second no longer falls through to the barred person. With no not_same pairs, nothing changes and no extra queries run.

How: a new _not_them() in domain/speakers.py, called by match().

Motivation and Context

Item from the personal feature plan sheet (speaker fixes: match() ignores not_same).

Screenshots (if appropriate):

n/a

Steps to reproduce (if appropriate):

Mark a voice "Not them here" on person A, then import another recording of that voice: it is no longer matched or suggested as A.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change; ! in the title)

Checklist:

  • The title is a Conventional Commit.
  • My code follows the code style of this project (make hooks checks it on commit).
  • I added or updated tests (tests/domain/test_voices.py::test_a_voice_never_goes_to_someone_it_was_said_not_to_be; it fails against the old match()).
  • My change requires documentation updates, and I have updated docs/ accordingly (docs/processing.md#people-and-namespaces).
  • Users need more than the title to understand it, so I wrote it under ## Unreleased in CHANGELOG.md. Written as changelog.d/voice-not-same.md, per build(release): changelog fragments in changelog.d/ instead of one Unreleased section #581.

Done questions (AGENTS.md)

  • Goal: delivers what the user wanted, merged on green CI.
  • Agents: usable through the API, MCP or an assistant tool. Applies to every import and to POST /speakers/{sid}/detach and not-same decisions made through the API.
  • Zero setup: no new prerequisite, .env edit or manual step.
  • Fewest clicks and keystrokes. Fewer wrong matches to fix by hand.
  • Configurable: new settings in the web app with defaults; wizard asks only what is required. n/a: no settings.
  • Light: default install still runs on a Raspberry Pi with cloud models. A few vector comparisons, only when pairs exist.
  • Private and secure: data local and encrypted, passkeys, threat model updated. Reads only this namespace's voiceprints; no new surface.
  • Cost: cheapest path, model calls in the activity ledger, budgets respected. n/a: no model calls.
  • User decides: consequential or new actions wait for the user; defaults unchanged. Honours a decision the person made.
  • Upgrades: existing installs upgrade safely (upgrade step for stored-data changes). Nothing stored changes.
  • Honest: sources cited; labelled built, in progress or planned. README wording and docs/requirements.md name the new test.
  • Tests, docs and generated files updated (make openapi). No API change.
  • Open standards; dependencies keep Lens MIT. n/a: no dependencies.
  • Result reported with evidence; "refine later" items written down. Merging people dropped these pairs; filed as Merging two speakers drops the merged-away person's "not the same" pairs #687 (fix follows).
  • Reuse: existing Lens code and permissive libraries reused, nothing reinvented. Reuses the not_same records.

Local CI: the container runs several times slower than usual, so I ran the changed tests directly: test_voices.py, test_speakers.py, test_voice_mode.py, test_speech.py pass, and ruff and mypy are clean. GitHub CI decides the merge.


Generated by Claude Code

match() ignored not_same: a voice split off from a person, or turned down
as them, could be auto-assigned or suggested as that person again when it
sat near their average voice, or when the person it sounded like was
already taken in the same recording. Now, of two people said not to be the
same, a voice goes to (or is suggested as) only the one it sounds more like,
by their voice overall or in any one recording they're in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QFUNzy1QZy5HhKAyJxTAYJ
@adeelahmad adeelahmad self-assigned this Oct 19, 2026
@adeelahmad
adeelahmad merged commit eb065e5 into main Oct 19, 2026
12 checks passed
@adeelahmad
adeelahmad deleted the claude/project-thread-xfmkzn branch October 19, 2026 16:37
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

0