fix(api): mint-time pending-overlap guard — never mint a second pending card for the same face #1055
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/pending-overlap-mint-guard"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Production duplicate carousel cards (verified 2026-10-06, face
60bf9b0dheld by both a stash-shadow card and a named-person card): a pending card writes no occurrence rows, so the face stays unassigned, the next recognition run re-clusters it and mints a SECOND pending card for the same face against a different target. The decision path already treats overlapping pending cards as mutually exclusive (an accept runsoverlapRejectionsand auto-rejects the sibling), so the stale sibling's decision errored (candidate-changed/Pending class-instance candidate not found) — and until then the carousel showed two cards for one face.Fix (spec 047 S3)
Both insert paths —
persistWorkerCandidates(next to PR #1052'scardHasFaceConfirmedElsewhereguard) andpersistSemisupervisedCandidates— now skip a candidate WHOLE: no insert, no exception, no state change to the existing card.Skip fires when any
face_annotationref already sits inoccurrence_refsof another STILL-PENDING candidate scoped exactly likePeopleDomainCandidateDecisionStrategy.pendingCandidateRows(same owner, same domain, same class_key,state='pending',candidate_type <> 'face_detection') that targets a DIFFERENT instance (incl. targetless-vs-targeted):log.info+ summary line when >0).Tests (all green:
rtk ./gradlew :apps:api:test— 1581 tests, 0 failures)8 new fixture tests in
ClassInstanceDiscoveryServiceTest:Unchanged and green: PR #1052 mint-guard tests, full Spec050SemisupervisedPostgresTest (46 tests incl. the 3 retarget-split tests).
Also
KNOWN_ISSUES.md: ISSUE-106 (med/mitigated/area:discovery)