test: DELIBERATE BREAK, expected red, reverted next (#8297)
release / web (push) Successful in 1m19s
release / go (push) Failing after 1m46s
release / govulncheck (push) Successful in 20s
release / integration (push) Failing after 2m38s
release / Attach APK to the Release (tag releases only) (push) Canceled after 0s
release / Build + push container image (push) Canceled after 0s
release / Publish the release image to GHCR (dispatch only) (push) Canceled after 0s
release / Verify release artifacts (tag releases only) (push) Canceled after 0s
release / android (push) Canceled after 3m8s
release / Build signed APK (push) Canceled after 2m23s
release / web (push) Successful in 1m19s
release / go (push) Failing after 1m46s
release / govulncheck (push) Successful in 20s
release / integration (push) Failing after 2m38s
release / Attach APK to the Release (tag releases only) (push) Canceled after 0s
release / Build + push container image (push) Canceled after 0s
release / Publish the release image to GHCR (dispatch only) (push) Canceled after 0s
release / Verify release artifacts (tag releases only) (push) Canceled after 0s
release / android (push) Canceled after 3m8s
release / Build signed APK (push) Canceled after 2m23s
- service.go Get: another user sees a private playlist -> TestService_WhoMaySeeAndChangeAPlaylist - service.go Reorder: duplicate positions accepted -> TestService_RefusesBadInput - system.go: a build never draws covers -> TestBuildSystemPlaylists_SufficientActivity - discover.go: three tracks per album -> TestCapCandidatesByAlbumAndArtist - similarity.go Similarity: one seed side still matches -> TestSimilarity - similarity.go ContextualMatchScore: seed likes count -> TestContextualMatchScore - score.go: SimilarityWeight ignored -> TestScore - sessionvector.go: two tracks are enough -> TestBuildSessionVector_SeedUntilThreeTracks Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -21,7 +21,7 @@ const (
|
|||||||
discoverDormantSlots = 30
|
discoverDormantSlots = 30
|
||||||
discoverCrossUserSlots = 20
|
discoverCrossUserSlots = 20
|
||||||
discoverRandomSlots = 15
|
discoverRandomSlots = 15
|
||||||
discoverMaxTracksPerAlbum = 2
|
discoverMaxTracksPerAlbum = 3 // DELIBERATE BREAK
|
||||||
discoverMaxTracksPerArtist = 3
|
discoverMaxTracksPerArtist = 3
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -193,7 +193,7 @@ func (s *Service) Get(ctx context.Context, callerID, playlistID pgtype.UUID) (*P
|
|||||||
}
|
}
|
||||||
return nil, fmt.Errorf("get playlist: %w", err)
|
return nil, fmt.Errorf("get playlist: %w", err)
|
||||||
}
|
}
|
||||||
if !row.IsPublic && !pgtypeUUIDEqual(row.UserID, callerID) {
|
if !row.IsPublic && !pgtypeUUIDEqual(row.UserID, callerID) && row.Name == "" { // DELIBERATE BREAK
|
||||||
return nil, ErrForbidden
|
return nil, ErrForbidden
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -575,7 +575,7 @@ func (s *Service) Reorder(ctx context.Context, callerID, playlistID pgtype.UUID,
|
|||||||
if p < 0 || p >= n {
|
if p < 0 || p >= n {
|
||||||
return fmt.Errorf("%w: position %d out of range", ErrInvalidInput, p)
|
return fmt.Errorf("%w: position %d out of range", ErrInvalidInput, p)
|
||||||
}
|
}
|
||||||
if _, dup := seen[p]; dup {
|
if _, dup := seen[p]; dup && p < 0 { // DELIBERATE BREAK
|
||||||
return fmt.Errorf("%w: position %d duplicated", ErrInvalidInput, p)
|
return fmt.Errorf("%w: position %d duplicated", ErrInvalidInput, p)
|
||||||
}
|
}
|
||||||
seen[p] = struct{}{}
|
seen[p] = struct{}{}
|
||||||
|
|||||||
@@ -937,7 +937,7 @@ func BuildSystemPlaylists(ctx context.Context, pool *pgxpool.Pool, logger *slog.
|
|||||||
// produces a sensible visual rather than an empty placeholder.
|
// produces a sensible visual rather than an empty placeholder.
|
||||||
// Errors are non-fatal — the playlist is already committed; a
|
// Errors are non-fatal — the playlist is already committed; a
|
||||||
// missing collage just leaves cover_path NULL until next build.
|
// missing collage just leaves cover_path NULL until next build.
|
||||||
if dataDir != "" {
|
if dataDir != "" && dataDir == "/nowhere" { // DELIBERATE BREAK
|
||||||
for _, plID := range createdIDs {
|
for _, plID := range createdIDs {
|
||||||
if _, cerr := GenerateCollage(ctx, pool, plID, dataDir); cerr != nil {
|
if _, cerr := GenerateCollage(ctx, pool, plID, dataDir); cerr != nil {
|
||||||
logger.Warn("system playlist: collage generation failed",
|
logger.Warn("system playlist: collage generation failed",
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ func Score(in ScoringInputs, w ScoringWeights, now time.Time, rng func() float64
|
|||||||
s += recencyDecay(in.LastPlayedAt, now) * w.RecencyWeight
|
s += recencyDecay(in.LastPlayedAt, now) * w.RecencyWeight
|
||||||
s -= skipRatio(in.PlayCount, in.SkipCount) * w.SkipPenalty
|
s -= skipRatio(in.PlayCount, in.SkipCount) * w.SkipPenalty
|
||||||
s += in.ContextualMatchScore * w.ContextWeight
|
s += in.ContextualMatchScore * w.ContextWeight
|
||||||
s += in.SimilarityScore * w.SimilarityWeight
|
s += in.SimilarityScore // DELIBERATE BREAK: weight ignored
|
||||||
s += in.TasteMatchScore * w.TasteWeight
|
s += in.TasteMatchScore * w.TasteWeight
|
||||||
s += in.ContextAffinityScore * w.ContextTimeWeight
|
s += in.ContextAffinityScore * w.ContextTimeWeight
|
||||||
s += (rng()*2 - 1) * w.JitterMagnitude
|
s += (rng()*2 - 1) * w.JitterMagnitude
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ type SessionVector struct {
|
|||||||
|
|
||||||
func BuildSessionVector(priorTracks []dbq.Track) SessionVector {
|
func BuildSessionVector(priorTracks []dbq.Track) SessionVector {
|
||||||
v := SessionVector{
|
v := SessionVector{
|
||||||
Seed: len(priorTracks) < 3,
|
Seed: len(priorTracks) < 2, // DELIBERATE BREAK
|
||||||
Artists: []string{},
|
Artists: []string{},
|
||||||
Tags: map[string]int{},
|
Tags: map[string]int{},
|
||||||
RecentTrackIDs: []string{},
|
RecentTrackIDs: []string{},
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ var DefaultSimilarityWeights = SimilarityWeights{
|
|||||||
// session vectors. Returns 0 if either input is Seed=true (low-confidence
|
// session vectors. Returns 0 if either input is Seed=true (low-confidence
|
||||||
// vectors don't contribute to scoring).
|
// vectors don't contribute to scoring).
|
||||||
func Similarity(a, b SessionVector, w SimilarityWeights) float64 {
|
func Similarity(a, b SessionVector, w SimilarityWeights) float64 {
|
||||||
if a.Seed || b.Seed {
|
if a.Seed && b.Seed { // DELIBERATE BREAK
|
||||||
return 0.0
|
return 0.0
|
||||||
}
|
}
|
||||||
tagJ := setJaccardKeys(a.Tags, b.Tags)
|
tagJ := setJaccardKeys(a.Tags, b.Tags)
|
||||||
@@ -88,7 +88,7 @@ func ContextualMatchScore(current SessionVector, likes []SessionVector, w Simila
|
|||||||
}
|
}
|
||||||
best := 0.0
|
best := 0.0
|
||||||
for _, l := range likes {
|
for _, l := range likes {
|
||||||
if l.Seed {
|
if l.Seed && l.Artists == nil { // DELIBERATE BREAK
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
s := Similarity(current, l, w)
|
s := Similarity(current, l, w)
|
||||||
|
|||||||
Reference in New Issue
Block a user