Conversation
The author pools are sanitized separately -- WP users and Co-Authors Plus
guest authors -- so combineAndReindexAuthors is the only place someone who
appears on both sides gets collapsed. It matched on exact display_name
equality, and the two sides routinely disagree on spacing or a capital: a WP
user's display name is title-cased off the login ("Erik Heyman-meltzer",
"DevanSuber") while the guest record is typed by hand. Every disagreement
emitted a second authors row for the same person, and
canonicalizeAuthorLogins then broke the colliding logins apart by appending
the row id -- which is why a slug like erik-heyman-meltzer-870 exists at all.
Match on the normalized name the within-pool dedupe already uses, and fold
the guest record's fields in rather than dropping it: fill anything blank,
and prefer the guest's spelling only where the two differ by case or
punctuation, so the hand-typed "Heyman-Meltzer" wins over the one derived
from a login. A genuinely different value is left alone -- a guest record
must not be able to rename somebody -- and the WP user's email always
survives, since cms_users links an account to an author row by email.
On the Aug 2026 export this collapses 875 rows to 866 and leaves no login
disambiguated by id.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HCehtwqGJGNYhmMVdwAAgF
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.
Why this is worth merging even though we are not reseeding again
Being straight about the value: this fixes a bug that only fires during a full
WP-export reseed, and the plan is that there will never be another one. So the
practical payoff today is zero. It is here because the diagnosis was done
anyway, the ETL is still the thing anyone would reach for if an import ever
does happen again, and leaving a known root cause undocumented in code is worse
than a small tested patch. Reviewers should feel free to weigh it accordingly.
The bug
Authors are sanitized in two independent pools — WP users (
auth_*) andCo-Authors Plus guest authors (
gauth_*). The MinHash similarity dedupe and thelogs/auth_conflicts.jsondecision cache both run within a pool only, socombineAndReindexAuthorsis the single place a person represented on bothsides gets collapsed.
It matched on exact
display_nameequality. The two sides routinelydisagree, because a WP user's display name is title-cased off the login while
the guest record is hand-typed:
Erik Heyman-meltzerErik Heyman-MeltzerDevan SuberDevanSuberEach mismatch emits a second
authorsrow for the same person.Utility.canonicalizeAuthorLoginsthen finds two identical logins and breaksthe tie with
dedupe_slug, which appends the row id — so an author slug endingin its own id (
erik-heyman-meltzer-870) is the fingerprint of exactly thismiss, not of anything done in the CMS.
The fix
Utility.cleanDocument(name, "similarity"), the normalization thewithin-pool dedupe already trusts.
first/last name lives);
spelling, since that one was typed by a person;
able to rename somebody;
emailis fill-only and never overwritten.cms_users.author_idis linkedby email at first login, so the emailed row is the one tied to a person's
CMS account.
Effect on the Aug 2026 export
Replayed against the cached
auth_output.json/gauth_output.json:The nine: Erik Heyman-Meltzer (the one a writer actually reported), plus
Devan Suber, Ben Wolbransky, Jacky Tsang, Colin Peterson, David Hagelgans,
Zachary Snyder, Atticus Deeny and Sally Ehlers — all eight of those the
missing-space variant.
Tests
tests/test_author_pool_merge.py, 8 cases. Four of them fail onmainandpass here; the other four pin behaviour this must not break (fresh ids, no id
collisions, no renaming, email survival). Full suite green — every module under
tests/run individually.Note on live data
Delta has already been repaired by hand for Erik (author 870 merged into 571).
The other eight duplicate rows exist on Delta but carry zero article links,
so they are cosmetic clutter in the author picker rather than split bylines.
🤖 Generated with Claude Code
https://claude.ai/code/session_01HCehtwqGJGNYhmMVdwAAgF