fix(web): carousel shows stored named target, not stale single-centroid ranking #1082

Merged
chris merged 2 commits from fix/carousel-stored-target-title into main 2026-10-10 01:01:40 +02:00
Owner

Bug (measured)

liveTopNamedRow overrode the card/dialog title and primary action with the live best-pair ranking top row from getCandidatePersonRanking — but that endpoint still computes the OLD single-centroid metric while the worker writes multi-representant candidates (ADR 0108). Measured: a card with stored target "Rikke" (dist 0.228) rendered as "Similar to Jutta", because Jutta's stale 12-face single-centroid ranked #1 in the old metric.

Fix

  • liveTopNamedRow (single chokepoint for BOTH render sites — card ~2925 and detail dialog ~2212) now returns null when the stored target (existingInstanceDisplayName) has a name: a named stored target is authoritative for the title and the primary action target id (candidate-merge-primary / candidate-accept / dialog primary).
  • Live retargeting only remains for cards whose stored target is unnamed/missing (self-correction intact).
  • Perf bonus: the card-level ensureCandidateLiveRanking fetch is skipped for named stored targets (their rows were provably only read via the gated liveTopNamedRow). Merge-picker rows (fetchCandidatePickerRows → fetchLiveRankingRows) are a separate path and untouched.

Tests (discovery-review.spec.ts)

  • New regression: NAMED stored target wins over the disagreeing live single-centroid ranking — card + dialog show "Rikke", primary decision posts the stored targetId, never rank-1 "Jutta".
  • Existing live-retarget tests converted to the unnamed-stored-target case (LIVE ranking target on card + dialog still covered).
  • Existing-person test updated: named stored target stays authoritative; picker rows still live-ordered.

Validation

  • npm run check: 0 errors
  • npm run build: ok
  • npm run test:unit: 71/71
  • Playwright: discovery-review.spec.ts 140/140; discovery-instance-tentative + discovery-instances + discovery-domain-selection 100/100 (desktop+mobile)
## Bug (measured) `liveTopNamedRow` overrode the card/dialog title and primary action with the live best-pair ranking top row from `getCandidatePersonRanking` — but that endpoint still computes the OLD single-centroid metric while the worker writes multi-representant candidates (ADR 0108). Measured: a card with stored target **"Rikke" (dist 0.228)** rendered as **"Similar to Jutta"**, because Jutta's stale 12-face single-centroid ranked #1 in the old metric. ## Fix - `liveTopNamedRow` (single chokepoint for BOTH render sites — card ~2925 and detail dialog ~2212) now returns null when the stored target (`existingInstanceDisplayName`) has a name: a named stored target is authoritative for the title **and** the primary action target id (`candidate-merge-primary` / `candidate-accept` / dialog primary). - Live retargeting only remains for cards whose stored target is unnamed/missing (self-correction intact). - Perf bonus: the card-level `ensureCandidateLiveRanking` fetch is skipped for named stored targets (their rows were provably only read via the gated `liveTopNamedRow`). Merge-picker rows (`fetchCandidatePickerRows` → `fetchLiveRankingRows`) are a separate path and untouched. ## Tests (discovery-review.spec.ts) - New regression: **NAMED stored target wins over the disagreeing live single-centroid ranking** — card + dialog show "Rikke", primary decision posts the stored `targetId`, never rank-1 "Jutta". - Existing live-retarget tests converted to the **unnamed**-stored-target case (LIVE ranking target on card + dialog still covered). - Existing-person test updated: named stored target stays authoritative; picker rows still live-ordered. ## Validation - `npm run check`: 0 errors - `npm run build`: ok - `npm run test:unit`: 71/71 - Playwright: discovery-review.spec.ts 140/140; discovery-instance-tentative + discovery-instances + discovery-domain-selection 100/100 (desktop+mobile)
fix(web): carousel shows stored named target, not stale single-centroid ranking
All checks were successful
Wiki Sync / Sync wiki from docs (push) Has been skipped
Build and Deploy / Detect changed services and test scopes (push) Successful in 2s
Build and Deploy / Android unit tests and debug APK (push) Has been skipped
Build and Deploy / Smoke API and media worker (push) Has been skipped
Build and Deploy / Smoke web (push) Has been skipped
Build and Deploy / Smoke ML worker (push) Has been skipped
Build and Deploy / Smoke people worker (push) Has been skipped
Build and Deploy / Build postgres image (push) Has been skipped
Build and Deploy / Build plants worker image (push) Has been skipped
Build and Deploy / Build converter worker image (push) Has been skipped
Build and Deploy / Deploy postgres (push) Has been skipped
Build and Deploy / Build API image (push) Has been skipped
Build and Deploy / Build media worker image (push) Has been skipped
Build and Deploy / Build ML worker image (push) Has been skipped
Build and Deploy / Build people worker image (push) Has been skipped
Build and Deploy / Build web image (push) Has been skipped
Build and Deploy / Deploy API (push) Has been skipped
Build and Deploy / Deploy web (push) Has been skipped
Build and Deploy / Deploy media worker (push) Has been skipped
Build and Deploy / Deploy ML worker (push) Has been skipped
Build and Deploy / Deploy plants worker (push) Has been skipped
Build and Deploy / Deploy people worker (push) Has been skipped
Build and Deploy / Deploy converter worker (push) Has been skipped
Build and Deploy / Clean Docker build artifacts (push) Has been skipped
Build and Deploy / Run scoped PR tests (push) Successful in 4m47s
78fcd72fd0
liveTopNamedRow overrode the card/dialog title and primary action with
the live best-pair ranking top row, but getCandidatePersonRanking still
computes the old single-centroid metric while the worker writes
multi-representant candidates (ADR 0108). Measured: stored target
'Rikke' (dist 0.228) rendered as 'Similar to Jutta' (stale 12-face
rank-1).

Gate the live retargeting on the stored target name: a NAMED stored
target is now authoritative for title AND primary action (both render
sites share liveTopNamedRow); the live ranking may only take over when
the stored target is unnamed/missing. The card-level ranking fetch is
skipped for named targets (rows would never be read); merge-picker row
fetches (fetchCandidatePickerRows) are untouched.

Tests: named-target regression test (stored title + stored decision id
despite disagreeing rank-1), live-retarget tests converted to the
unnamed-stored-target case.
docs: KNOWN_ISSUES ref PR#1082
All checks were successful
Wiki Sync / Sync wiki from docs (push) Has been skipped
Build and Deploy / Detect changed services and test scopes (push) Successful in 2s
Build and Deploy / Android unit tests and debug APK (push) Has been skipped
Build and Deploy / Smoke API and media worker (push) Has been skipped
Build and Deploy / Smoke web (push) Has been skipped
Build and Deploy / Smoke ML worker (push) Has been skipped
Build and Deploy / Smoke people worker (push) Has been skipped
Build and Deploy / Build postgres image (push) Has been skipped
Build and Deploy / Build plants worker image (push) Has been skipped
Build and Deploy / Build converter worker image (push) Has been skipped
Build and Deploy / Deploy postgres (push) Has been skipped
Build and Deploy / Build API image (push) Has been skipped
Build and Deploy / Build media worker image (push) Has been skipped
Build and Deploy / Build ML worker image (push) Has been skipped
Build and Deploy / Build people worker image (push) Has been skipped
Build and Deploy / Build web image (push) Has been skipped
Build and Deploy / Deploy API (push) Has been skipped
Build and Deploy / Deploy web (push) Has been skipped
Build and Deploy / Deploy media worker (push) Has been skipped
Build and Deploy / Deploy ML worker (push) Has been skipped
Build and Deploy / Deploy plants worker (push) Has been skipped
Build and Deploy / Deploy people worker (push) Has been skipped
Build and Deploy / Deploy converter worker (push) Has been skipped
Build and Deploy / Clean Docker build artifacts (push) Has been skipped
Build and Deploy / Run scoped PR tests (push) Successful in 4m50s
ce463e2118
chris merged commit 68a468465c into main 2026-10-10 01:01:40 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
chris/memories!1082
No description provided.