feat(people): add recognition trigger after discovery_people job completes #601

Merged
chris merged 3 commits from fix/people-recognition-pipeline into main 2026-07-12 23:54:44 +02:00
Owner

Summary

Spec 014 FR-P01..P06. Adds recognition trigger pipeline for people discovery.

What changed

  1. PeopleDiscoveryPostCompletionListener — @TransactionalEventListener(AFTER_COMMIT) fires after discovery_people job completes. Enqueues owner_face_recognition job for the media owner if:

    • New discovery_results with state=owner_tentative exist for owner
    • No pending owner_face_recognition job already queued (idempotent guard, FR-P06)
  2. OwnerFaceEmbeddingsController — GET /api/worker/jobs/{jobId}/owner-face-embeddings returns face embeddings for owner_face_recognition worker jobs. Joins discovery_results → class_instance_occurrences → class_occurrence_embeddings.

  3. WorkerJobEnqueueService.enqueueOwnerFaceRecognitionJob — Creates owner_face_recognition job with domainKey=people, maxDistance=0.35 threshold (FR-P03). Idempotent: returns existing job if already pending.

Tests

9 tests covering:

  • Listener enqueues job on discovery_people completion
  • Listener skips if no owner_tentative results
  • Listener idempotent guard (duplicate suppression)
  • Listener ignores non-people job types
  • Listener ignores events without ownerId
  • Enqueue method creates correct payload
  • Enqueue method idempotent
  • Enqueue method creates new after previous completed
  • Controller returns embeddings correctly

Version bump

0.98 → 0.99

## Summary Spec 014 FR-P01..P06. Adds recognition trigger pipeline for people discovery. ### What changed 1. **PeopleDiscoveryPostCompletionListener** — `@TransactionalEventListener(AFTER_COMMIT)` fires after `discovery_people` job completes. Enqueues `owner_face_recognition` job for the media owner if: - New `discovery_results` with `state=owner_tentative` exist for owner - No pending `owner_face_recognition` job already queued (idempotent guard, FR-P06) 2. **OwnerFaceEmbeddingsController** — `GET /api/worker/jobs/{jobId}/owner-face-embeddings` returns face embeddings for `owner_face_recognition` worker jobs. Joins `discovery_results` → `class_instance_occurrences` → `class_occurrence_embeddings`. 3. **WorkerJobEnqueueService.enqueueOwnerFaceRecognitionJob** — Creates `owner_face_recognition` job with `domainKey=people`, `maxDistance=0.35` threshold (FR-P03). Idempotent: returns existing job if already pending. ### Tests 9 tests covering: - Listener enqueues job on `discovery_people` completion - Listener skips if no `owner_tentative` results - Listener idempotent guard (duplicate suppression) - Listener ignores non-people job types - Listener ignores events without ownerId - Enqueue method creates correct payload - Enqueue method idempotent - Enqueue method creates new after previous completed - Controller returns embeddings correctly ### Version bump 0.98 → 0.99
feat(people): add recognition trigger after discovery_people job completes (spec 014 FR-P01..P06)
All checks were successful
Build and Deploy / Detect changed services and test scopes (push) Successful in 4s
Build and Deploy / Run scoped PR tests (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 / Build plants worker image (push) Has been skipped
Build and Deploy / Build people worker image (push) Has been skipped
Build and Deploy / Build converter worker image (push) Has been skipped
Build and Deploy / Build API image (push) Has been skipped
Build and Deploy / Build web 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 / 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
df72dd2dc2
fix(people): address PR #601 test review findings
All checks were successful
Build and Deploy / Detect changed services and test scopes (push) Successful in 3s
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 / Build plants worker image (push) Has been skipped
Build and Deploy / Build people worker image (push) Has been skipped
Build and Deploy / Build converter worker image (push) Has been skipped
Build and Deploy / Build API image (push) Has been skipped
Build and Deploy / Build web 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 / 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 2m37s
8b3194bd6c
- Move orphaned model_conversion Javadoc above its method in WorkerJobEnqueueService
- Make ObjectMapper a static field in OwnerFaceEmbeddingsController (was new per request)
- Fix assertion precision: contains("maxDistance":0.35) instead of separate strings
- Add 5 missing tests:
  - Controller: job with no ownerId in payload returns empty
  - Controller: malformed embedding JSON skips row
  - Controller: blank embedding string skips row
  - Cross-owner isolation: no job for other owner
  - Listener: non-tentative states only skips
- Bump version to 1.00
merge: resolve version conflict (keep 1.00)
All checks were successful
Build and Deploy / Detect changed services and test scopes (push) Successful in 3s
Build and Deploy / Run scoped PR tests (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 / Build plants worker image (push) Has been skipped
Build and Deploy / Build people worker image (push) Has been skipped
Build and Deploy / Build converter worker image (push) Has been skipped
Build and Deploy / Build API image (push) Has been skipped
Build and Deploy / Build web 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 / 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
9cabca6eca
chris merged commit 08d0bab9fc into main 2026-07-12 23:54:44 +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!601
No description provided.