Repository navigation
fix(speakers): carry "not the same" pairs over when merging people - #692
Merged
Merged
Conversation
Merging B into A now rewrites each not_same pair naming B to name A, keyed and ordered as not_same() makes them, dropping a pair that would be A-A or that A already has; undoing the merge puts the original pairs back. A new upgrade step (speaker-not-same-merged) gives pairs left naming people merged away before this the person they were merged into; it keeps the old rows so undo still works, and is safe to run twice. Closes #687 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QFUNzy1QZy5HhKAyJxTAYJ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Adeel · project thread
Closes #687.
Description
Before: merging person B into A moved B's voices and appearances but left B's "not the same" pairs pointing at nobody, so a decision someone made about B was lost after the merge, and voice matching (#691) could again offer a voice to someone it was said not to be.
After: merging B into A rewrites every pair naming B to name A. A pair that would become A–A is dropped, and a pair A already has is kept once with its original
byandat. Undoing the merge deletes the rewritten pairs and puts the originals back. An upgrade step,speaker-not-same-merged, does the same for merges made before this change (following merges of merges); it keeps the old rows so undoing an old merge still works and is safe to run twice.How:
speakers.merge()andundo()call a new_repointed();migrate_not_same()is registered inmigrations.steps().Motivation and Context
Gap found while making
match()honournot_same(personal feature plan, speaker fixes).Screenshots (if appropriate):
n/a
Steps to reproduce (if appropriate):
Mark B and C as not the same, merge B into A: A and C are now not the same, and C's voices are no longer suggested as A.
Types of changes
!in the title)Checklist:
make hookschecks it on commit).test_voices.py::test_merging_keeps_who_they_are_not,test_voices.py::test_upgrade_gives_pairs_lost_to_merges_to_who_they_were_merged_into,test_migrations.pySHIPPED; the merge test fails without the fix).docs/accordingly (docs/processing.md,docs/api.md,docs/database.md#upgrades).## UnreleasedinCHANGELOG.md. Written aschangelog.d/speaker-merge-not-same.md, per build(release): changelog fragments in changelog.d/ instead of one Unreleased section #581.Done questions (AGENTS.md)
.envedit or manual step. The upgrade step runs on its own.speaker-not-same-merged, safe to run twice (checked by the existing repeat test).docs/requirements.mdnames the new tests.make openapi). No API change.Local CI: the container runs several times slower than usual, so I ran the changed tests directly:
test_voices.py,test_migrations.py,test_speakers.py(34 passed), ruff and mypy clean. GitHub CI (embedded and server SurrealDB) decides the merge.Generated by Claude Code