Skip to content

BackgroundCheck: merge people on identifiers first, never on a name alone across sources - #474

Merged
StephenAbbott merged 2 commits into
mainfrom
fix/backgroundcheck-person-merge
Oct 21, 2026
Merged

StephenAbbott merged 2 commits into
mainfrom
fix/backgroundcheck-person-merge

Conversation

@StephenAbbott

Copy link
Copy Markdown
Owner

Notion: https://app.notion.com/p/3a67f3dc2928819f9286e585498e9c1e

BackgroundCheck merged people on order-insensitive name + birth year and ignored identifiers. Two same-name records with no birth year therefore always merged into one card. That covers Unilever's Wikidata "Fernando Fernández", where two different people's items ended up on one card. It would also merge two Estonians with the same name whom the register keeps apart by person key, since the open data has no birth dates.

The new rule (groupPersonRecords)

  1. Records that share an identifier (from identifiers or the identifying annotations) are one person.
  2. A same-name pair merges when both have a birth year and the years agree.
  3. A same-name pair with no birth year on either side merges only when both come from the same source. Across sources they stay two cards, and clustering offers them at Medium.
  4. Nothing merges across two different values of ONE_PERSON_PER_VALUE_SCHEMES (EE-ARIREGISTER-HASH, WIKIDATA), and scorePair no longer offers such a pair as a cluster. Companies House officer ids are left out on purpose, because one person can hold several.

A birth year on one side and none on the other still doesn't merge, as before.

Measured on production exports (20 Oct 2026), before → after

  • Unilever: 12 → 13 people. The two Wikidata items are split; each is offered at Medium against the real CFO, never against each other.
  • HSBC: unchanged (19 people, no clusters).
  • Tallink: 14 people either way. Its two Medium clusters (the four Hanschmidts, and Enn and Eve Pant) are gone, because the register gives each a different person key.

frontend/scripts/cluster-eval.mjs now imports the real modules (npx vite-node) instead of a copy that was already out of date.

Tests: vitest 109 files / 1364 tests pass (+13 tests, +1 file); tsc, lint:design and build are clean. The change is frontend-only; no backend test references these modules.


Generated by Claude Code

Stephen Abbott Pugh and others added 2 commits October 20, 2026 15:20
…lone across sources

extractConnectedPeople keyed people on name + birth year only, so two
same-name records with no birth year always merged: Unilever's Wikidata
"Fernando Fernández" card held two different people's items, and two
Estonians the register keeps apart by isikukood_hash would share a card.

groupPersonRecords now merges on a shared identifier first, then on name +
agreeing birth year, then on name alone only within one source; it never
merges across two values of a one-person-per-value scheme (Estonian person
key, Wikidata), and clustering no longer offers such pairs. cluster-eval.mjs
imports the real modules instead of a stale copy.

Notion: https://app.notion.com/p/3a67f3dc2928819f9286e585498e9c1e

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PdS422vAoRSv8Rf5NxY8We
Brings the branch up to date with main (Phases 389–392) before merging.

Co-Authored-By: Claude <noreply@anthropic.com>
Release-Steward: scheduled run 2026-10-21
@StephenAbbott
StephenAbbott merged commit 25ad358 into main Oct 21, 2026
8 checks passed
@StephenAbbott
StephenAbbott deleted the fix/backgroundcheck-person-merge branch October 21, 2026 06:05
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