feat(playlists): twelve Songs like mixes a day, drawn from a top-24 artist pool
release / go (push) Successful in 2m2s
release / web (push) Successful in 1m14s
release / govulncheck (push) Successful in 20s
release / integration (push) Failing after 4m5s
release / android (push) Successful in 4m38s
release / Build signed APK (push) Successful in 5m13s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Skipped
release / Verify release artifacts (tag releases only) (push) Skipped

Six mixes stretched to oversized circles on a wide window; twelve fill
the row at its normal tile size. The pool doubles with the count so the
daily shuffle still rotates which artists get a mix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-24 07:24:58 -05:00
co-authored by Claude Opus 5.5
parent 46d97e51f7
commit 806658aa60
4 changed files with 16 additions and 15 deletions
+4 -4
View File
@@ -159,7 +159,7 @@ func TestPickDailySeeds_EmptyPool(t *testing.T) {
}
}
// pickSeedArtistsForDay takes the user's top-12 candidate artists and
// pickSeedArtistsForDay takes the user's top-24 candidate artists and
// returns songsLikeSeedCount of them via daily-deterministic shuffle.
// Verifies the picker is deterministic within a day, varies across days,
// and degrades gracefully when fewer than songsLikeSeedCount candidates
@@ -186,7 +186,7 @@ func seedSetKey(seeds []pgtype.UUID) string {
func TestPickSeedArtistsForDay_DeterministicWithinDay(t *testing.T) {
u := pgtype.UUID{Bytes: [16]byte{1}, Valid: true}
pool := bigSeedPool(10)
pool := bigSeedPool(24)
a := pickSeedArtistsForDay(pool, u, "2026-05-04")
b := pickSeedArtistsForDay(pool, u, "2026-05-04")
if len(a) != songsLikeSeedCount || len(b) != songsLikeSeedCount {
@@ -201,9 +201,9 @@ func TestPickSeedArtistsForDay_DeterministicWithinDay(t *testing.T) {
func TestPickSeedArtistsForDay_VariesAcrossDays(t *testing.T) {
u := pgtype.UUID{Bytes: [16]byte{1}, Valid: true}
pool := bigSeedPool(10)
pool := bigSeedPool(24)
// Collect the seed set (order-independent) across many dates. With
// C(10, songsLikeSeedCount) combinations, 30 dates yield >=2 distinct sets.
// C(24, songsLikeSeedCount) combinations, 30 dates yield >=2 distinct sets.
seen := map[string]bool{}
for i := 1; i <= 30; i++ {
got := pickSeedArtistsForDay(pool, u, "2026-05-"+twoDigits(i))
+6 -5
View File
@@ -35,7 +35,7 @@ type seedArtistRow struct {
}
// pickSeedArtistsFromRows projects sqlc rows into the seed list. The
// SQL already orders by score DESC + artist_id and LIMIT 12, so this is
// SQL already orders by score DESC + artist_id and LIMIT 24, so this is
// just a column projection — but pulling it into a function keeps the
// call-site readable and makes the post-fetch path testable without
// a database.
@@ -106,10 +106,11 @@ func pickDailySeeds(pool []pgtype.UUID, userID pgtype.UUID, dateStr string, n in
}
// songsLikeSeedCount is how many "Songs like {artist}" mixes to build
// each day, enough to fill Songs-like's own Home row. Drawn from
// PickSeedArtists' deeper top-12 pool via a daily-deterministic shuffle so
// the set still rotates day to day rather than pinning the same six artists.
const songsLikeSeedCount = 6
// each day, enough to fill Songs-like's own Home row at its normal tile
// size on a wide window. Drawn from PickSeedArtists' deeper top-24 pool via
// a daily-deterministic shuffle so the set still rotates day to day rather
// than pinning the same twelve artists.
const songsLikeSeedCount = 12
// pickSeedArtistsForDay picks up to songsLikeSeedCount seed artists for
// the Songs-like mixes; For-You uses pickDailySeeds directly with