fix(albums): require at least 4 images for album suggestions #1243

Merged
chris merged 1 commit from fix/album-suggestion-min-size into main 2026-10-15 21:46:09 +02:00
Owner

Summary

  • Raise the deterministic local-event minimum from 3 to 4 images (LOCAL_EVENT_MINIMUM_MEDIA_COUNT), so small 3-photo clusters no longer become suggestions.
  • Add LEARNED_MINIMUM_MEDIA_COUNT = 4 to the learned materialization path: candidates with fewer than 4 members are skipped after window consolidation and before rank assignment, so adjacent small windows can still consolidate into a ≥4-member union while undersized candidates never reach the review queue.
  • Update generation/learned test fixtures to carry ≥4 media while preserving each scenario (covered-window scan, consolidation union, accepted-album edit conversion); guard parent-filtering tests against vacuous allSatisfy passes; add regression tests for the 4-image minimum on both paths.
  • Update the clustering-research spec threshold table (3 → 4) and its rationale.

Verification

  • rtk ./gradlew :apps:api:test --tests 'dev.memories.api.albums.*' → BUILD SUCCESSFUL
  • rtk ./gradlew :apps:api:test → BUILD SUCCESSFUL (2078 tests, 0 failures, 9 pre-existing env-gated skips)
## Summary - Raise the deterministic local-event minimum from 3 to 4 images (`LOCAL_EVENT_MINIMUM_MEDIA_COUNT`), so small 3-photo clusters no longer become suggestions. - Add `LEARNED_MINIMUM_MEDIA_COUNT = 4` to the learned materialization path: candidates with fewer than 4 members are skipped after window consolidation and before rank assignment, so adjacent small windows can still consolidate into a ≥4-member union while undersized candidates never reach the review queue. - Update generation/learned test fixtures to carry ≥4 media while preserving each scenario (covered-window scan, consolidation union, accepted-album edit conversion); guard parent-filtering tests against vacuous `allSatisfy` passes; add regression tests for the 4-image minimum on both paths. - Update the clustering-research spec threshold table (3 → 4) and its rationale. ## Verification - `rtk ./gradlew :apps:api:test --tests 'dev.memories.api.albums.*'` → BUILD SUCCESSFUL - `rtk ./gradlew :apps:api:test` → BUILD SUCCESSFUL (2078 tests, 0 failures, 9 pre-existing env-gated skips)
fix(albums): require at least 4 images for album suggestions
All checks were successful
Wiki Sync / Sync wiki from docs (push) Has been skipped
Build and Deploy / Detect changed services and test scopes (push) Successful in 2s
Build and Deploy / Build postgres image (push) Has been skipped
Build and Deploy / Build plants worker image (push) Has been skipped
Build and Deploy / Build converter worker image (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 / Smoke people worker (push) Has been skipped
Build and Deploy / Build Android CI image (push) Has been skipped
Build and Deploy / Android unit tests and debug APK (push) Has been skipped
Build and Deploy / Build people worker image (push) Has been skipped
Build and Deploy / Deploy postgres (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 8m42s
67eb76b81c
Enforce a minimum member count of 4 on both album-suggestion paths:

- Deterministic path: raise LOCAL_EVENT_MINIMUM_MEDIA_COUNT from 3 to 4
  (DBSCAN cluster-size filter and algorithm parameters follow the
  constant automatically).
- Learned path: add LEARNED_MINIMUM_MEDIA_COUNT and skip candidates with
  fewer than 4 members in the materializeLearnedSuggestions retention
  loop, after window consolidation and before rank assignment, so
  consolidation of adjacent small windows keeps working.

Update generation/learned test fixtures to carry >=4 media while
preserving each scenario (covered-window scan, consolidation union,
accepted-album edit conversion), guard the parent-filtering tests
against vacuous allSatisfy passes, and add regression tests for the
4-image minimum on both paths. Update the clustering research spec
threshold table accordingly.
chris merged commit 8e88400969 into main 2026-10-15 21:46:09 +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!1243
No description provided.