fix(people): return known-person faces in owner-face-embeddings (fix empty similarity suggestions) #714
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/face-embeddings-known-persons"
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?
Root cause
OwnerFaceEmbeddingsController(worker endpointGET /api/worker/jobs/{jobId}/owner-face-embeddings) filters its accepted branch ondiscovery_results.state = 'owner_tentative'only. But accepted faces transitionowner_tentative → owner_recognizedvia the V117 backfill +ClassInstanceDiscoveryService(L886-912) once their occurrence is accepted. Known-person faces therefore disappeared from the embedding fetch — the worker only ever saw still-tentative faces, producing empty similarity suggestions.Fix
Accepted branch state filter:
AND dr.state IN ('owner_tentative', 'owner_recognized')(one line). Pending branch unchanged (stillowner_tentativeonly). No response-shape change, no dedup/ranking change, workers/people untouched.ID-space proof (why no personId merge is needed)
class_instance_occurrences.occurrence_keystoresdiscovery_results.idas text (V118 backfill joins oncio.occurrence_key = pfe.face_annotation_id::text; fixture insertsoccurrence_key = faceAnnotationId.toString()).dr.idis thefaceAnnotationIdreturned by this endpoint, and it is the same value used as theassignmentskey in the job payload (WorkerJobEnqueueServiceL187:cio.occurrence_key AS "faceAnnotationId"). Face→person mapping therefore already travels via the job payloadassignments; no response change needed.Assignments stay in the job payload
No size cap on job payload — documented no-premature-optimization (current stock ~3 embeddings per owner, ref ISSUE-027). Revisit only if payload size ever becomes real.
Scope notes
workers/people(incl.main.py) unchanged. No migration changes.WorkerJobEnqueueServiceunchanged.Tests
New
OwnerFaceEmbeddingsControllerTest(Testcontainers + Flyway, mirrorsPendingEmbeddingReconciliationSchedulerTest):assignmentsmaps recognized face → person recordVerification: targeted test green;
:apps:api:compileJavagreen; fullcleanTestsuite green — 772 tests, 0 failures, 0 errors (ISSUE-026 CI blindspot compensation).Version bump: 1.21.26 → 1.21.27.