Skip to content

Suggestions: turn artists away by the DJ's fading rule (MAD-762) - #50

Merged
madeofpendletonwool merged 1 commit into
mainfrom
mad-762-suggest-turned-away
Oct 7, 2026
Merged

madeofpendletonwool merged 1 commit into
mainfrom
mad-762-suggest-turned-away

Conversation

@madeofpendletonwool

Copy link
Copy Markdown
Owner

Closes MAD-762.

The DJ's half of MAD-762 already landed with MAD-756 (#47). It added avoidBelow = -0.25 and TestProfileSkipsFade with the issue's three cases. This PR does the other half: search suggestions (suggest.TurnedAway, ADR 0010) still turned an artist away for any skip, with no decay.

What changed

  • suggest.TurnedAway(snap, history, now) now returns dj.NewProfile(...).Avoid. Suggestions and the DJ now share one rule:
    • A skip counts more the sooner it comes.
    • It fades with a 2-hour half-life.
    • It's weighed against full listens, queued songs and hearts.
    • An artist is turned away only below −0.25.
  • Artists are compared by dj.ArtistKey (match.Simplify), the way the DJ keys them.
  • ADR 0010 and ADR 0012 describe the shared rule. The "unfaded rule until MAD-759" note is gone. MAD-759 still moves the rest of suggestions onto the DJ.

Behavior change

Under the old rule, one full listen brought a skipped artist back. Under the DJ's rule, a quick skip (−1.5) outweighs one full listen (+1) until it fades or the room plays them again. This matches what autopilot already does.

Tests

  • The suggest test env ran the service on the wall clock while its history used a fixed clock. That only worked because skips never faded. The service now uses the test clock.
  • New TestSkipFades: two days after a skip, the artist is suggested again.
  • TestSkipMemory now checks that two full listens outweigh a quick skip.
  • go test -race ./... and golangci-lint (0 issues) pass. There are no web changes.

🤖 Generated with Claude Code

The DJ's half of MAD-762 landed with MAD-756: an artist is turned away
only while its decayed net signal is below -0.25, not whenever it's
negative. Suggestions still used their own rule: any skip, never
offset by time, turned an artist away until a full listen or queued
song brought them back.

- suggest.TurnedAway now reads dj.Profile.Avoid, so a skip fades with
  the DJ's 2-hour half-life and is weighed against plays, queued songs
  and hearts. Artists are compared by dj.ArtistKey.
- The suggest tests now run the service on the test clock (it was on
  the wall clock, which only worked because skips never faded).
- TestSkipFades: two days after a skip, the artist is suggested again.
  TestSkipMemory: two full listens outweigh a quick skip.
- ADR 0010 and 0012 describe the shared rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@madeofpendletonwool
madeofpendletonwool merged commit d8b47ed into main Oct 7, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant