fix(api): people suggest floor 0.5 + supersede sub-floor weak matches, debounce recognition re-arm #823

Merged
chris merged 1 commit from fix/quality-threshold-api into main 2026-09-22 22:20:56 +02:00
Owner

Problem

  1. people suggest_max_distance was widened to 0.6 in V130 — below Immich's hardened 0.5 default (they lowered it FROM 0.6 for exactly the 'multiple people recognized as the same person' complaints we now see; production has 1,855 pending weak suggestions averaging 45% similarity). 2. Existing sub-floor noise stays pending forever. 3. Every accept re-arms a full 83-237s recognition run — back-to-back during review sessions (R4).

Changes

  • V135 migration: people suggest_max_distance 0.6 → 0.5 (only when >0.5), + supersedes pending weak single-face candidates with confidence < 0.5 (exact predicate parity with isWeakSingleFaceCandidate: payload weakMatch='true', cluster_person_match, people/person). Measured at authoring: 754 candidates superseded (avg 45.2%), 1,101 kept, other domains untouched. Row counts + provenance in migration comments.
  • Recognition re-arm debounce: FaceRecognitionReconcileScheduler skips enqueue if the owner had an owner_face_recognition job created within the last 10 min — dirty marker RETAINED on skip (eventual processing guaranteed, just rate-limited: review burst → at most one run per 10 min per owner). Recency check measured 0.5 ms on production.

Tests

  • New PeopleSuggestFloorMigrationPostgresTest (real PG via Testcontainers): executes V135 against seeded fixtures — weak 0.44 superseded (decided_at set), weak 0.50/0.55 stay, non-weak stays, wrong-type stays, accepted stays, other domain stays, idempotent rerun, flyway history v135.
  • FaceRecognitionReconcileSchedulerTest +3: debounce skip retains marker; old job → enqueue; skipped tick → later tick catches up.
  • Scoped suites green: Reconcile/Migration/Flyway 22 tests, discovery package 464 tests.

Companion PR #822 (worker kNN consensus): new weak suggestions need ≥2 supporting faces ≤0.5 with mean-based confidence ≥0.5 — the two changes are coherent: sub-floor noise can no longer be emitted and is swept from the existing backlog.

## Problem 1. people suggest_max_distance was widened to 0.6 in V130 — below Immich's hardened 0.5 default (they lowered it FROM 0.6 for exactly the 'multiple people recognized as the same person' complaints we now see; production has 1,855 pending weak suggestions averaging 45% similarity). 2. Existing sub-floor noise stays pending forever. 3. Every accept re-arms a full 83-237s recognition run — back-to-back during review sessions (R4). ## Changes - **V135 migration**: people suggest_max_distance 0.6 → 0.5 (only when >0.5), + supersedes pending weak single-face candidates with confidence < 0.5 (exact predicate parity with `isWeakSingleFaceCandidate`: payload weakMatch='true', cluster_person_match, people/person). Measured at authoring: **754 candidates superseded** (avg 45.2%), 1,101 kept, other domains untouched. Row counts + provenance in migration comments. - **Recognition re-arm debounce**: FaceRecognitionReconcileScheduler skips enqueue if the owner had an owner_face_recognition job created within the last 10 min — dirty marker RETAINED on skip (eventual processing guaranteed, just rate-limited: review burst → at most one run per 10 min per owner). Recency check measured 0.5 ms on production. ## Tests - New PeopleSuggestFloorMigrationPostgresTest (real PG via Testcontainers): executes V135 against seeded fixtures — weak 0.44 superseded (decided_at set), weak 0.50/0.55 stay, non-weak stays, wrong-type stays, accepted stays, other domain stays, idempotent rerun, flyway history v135. - FaceRecognitionReconcileSchedulerTest +3: debounce skip retains marker; old job → enqueue; skipped tick → later tick catches up. - Scoped suites green: Reconcile/Migration/Flyway 22 tests, discovery package 464 tests. Companion PR #822 (worker kNN consensus): new weak suggestions need ≥2 supporting faces ≤0.5 with mean-based confidence ≥0.5 — the two changes are coherent: sub-floor noise can no longer be emitted and is swept from the existing backlog.
fix(api): people suggest floor 0.5 + supersede sub-floor weak matches, debounce recognition re-arm (10 min/owner)
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 ML 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 1m40s
448ee1635d
chris merged commit 3807484a6f into main 2026-09-22 22:20:56 +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!823
No description provided.