feat(people): add periodic recognition scan scheduler (FR-P04) #603

Merged
chris merged 2 commits from agent/periodic-recognition-scan into feat/people-periodic-scan 2026-07-13 08:18:52 +02:00
Owner

Summary

PeopleDiscoveryRecognitionScheduler scans owners with unrecognized discovery_results every 5 minutes and triggers owner_face_recognition jobs if due.

Motivation

Spec 014 FR-P04: fallback periodic scan catches discovery_results missed by the immediate PeopleDiscoveryPostCompletionListener trigger.

Changes

  • New PeopleDiscoveryRecognitionScheduler @Component with @Scheduled(fixedDelay=300000)
  • Queries owners with owner_tentative discovery_results and no pending recognition job
  • Calls WorkerJobEnqueueService.enqueueOwnerFaceRecognitionJob() per owner

Depends on

PR #601 (S014T004)

Verification

  • compileJava passes
  • Follows existing scheduler pattern (DiscoveryReprocessScheduler)
## Summary PeopleDiscoveryRecognitionScheduler scans owners with unrecognized discovery_results every 5 minutes and triggers owner_face_recognition jobs if due. ## Motivation Spec 014 FR-P04: fallback periodic scan catches discovery_results missed by the immediate PeopleDiscoveryPostCompletionListener trigger. ## Changes - New PeopleDiscoveryRecognitionScheduler @Component with @Scheduled(fixedDelay=300000) - Queries owners with owner_tentative discovery_results and no pending recognition job - Calls WorkerJobEnqueueService.enqueueOwnerFaceRecognitionJob() per owner ## Depends on PR #601 (S014T004) ## Verification - compileJava passes - Follows existing scheduler pattern (DiscoveryReprocessScheduler)
feat(people): add periodic recognition scan scheduler (@Scheduled 5min, FR-P04)
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 media worker image (push) Has been skipped
Build and Deploy / Build web 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
71f726e8f5
PeopleDiscoveryRecognitionScheduler scans owners with unrecognized
discovery_results (state='owner_tentative') every 5 minutes and
triggers owner_face_recognition jobs if due. Idempotent — skips
owners with pending recognition jobs.
fix(people): add error handling in scan loop + scheduler tests
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 media worker image (push) Has been skipped
Build and Deploy / Build web 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 2m48s
b7bb223568
- Wrap each owner enqueue call in try-catch; one failure must not abort scan
- Add PeopleDiscoveryRecognitionSchedulerTest covering:
  - Happy path: owner_tentative → scan enqueues job
  - Empty: no tentative results → no jobs
  - Idempotency: pending job → skipped
  - Completed job → re-enqueues
  - Multiple owners → each enqueued
  - Non-people domain results ignored
  - Non-tentative state ignored
  - Correct payload fields (ownerId, domainKey, maxDistance)
chris merged commit 9f6573ea82 into feat/people-periodic-scan 2026-07-13 08:18:52 +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!603
No description provided.