Skip to content

Suggestions on the DJ engine (MAD-759) - #51

Merged
madeofpendletonwool merged 1 commit into
mainfrom
mad-759-suggest-engine
Oct 7, 2026
Merged

madeofpendletonwool merged 1 commit into
mainfrom
mad-759-suggest-engine

Conversation

@madeofpendletonwool

Copy link
Copy Markdown
Owner

Moves search suggestions (ADR 0010, "your vibe" / "group vibe") onto the DJ (ADR 0012), so they get the same profile, candidates and scoring as autopilot. Phase 7, stage 3.

What changed

  • suggest.Service.Graph: when it's set (in main.go, whenever the graph has sources), suggestions ask dj.Engine.Choose first.
    • Mine narrows the taste to the asker's own (dj.Request.Member). Group uses the room's, with members' tastes mixed as they are for autopilot.
    • source=queue reads the taste from the songs playing and waiting (dj.Request.Queued). When nothing is queued, the songs that played through stand in.
    • What the room heard, skipped and doubts stays room-wide in both narrowed tastes.
    • Picks are matched only on the asker's links that can search, so every suggestion can still be queued by the asker. because is the member's song by the artist the pick leads from. A pick that only autopilot's songs led to has no seed, so it's left out.
    • The DJ is asked at explore 25 (near the vibe), the same as before, when suggestions always used "similar".
  • dj.Choose for longer lists: n picks draw 2n candidates from a shortlist of at least 2n songs, with at most 2 per artist. Up to 6 candidates are looked up on services at once, in draw order. Autopilot asks for 2 picks, so it tries exactly the same candidates as before. Opening sessions is serialized, because the Finder isn't safe for concurrent use.
  • Fallback: with no graph, or a graph that knows nothing near the vibe, suggestions use the services' own recommendations as before.
  • Removed duplicated Finder paths:
    • Finder.Like replaces the recommend-or-search branch that suggestions and GetQueueItemSimilar each had.
    • suggest.TrackOf is gone; callers use dj.TrackOf.
    • suggest.ArtistKey now compares names with dj.ArtistKey.
    • Autopilot's own fallback (like/choosePick, with its discovery rules) is unchanged.

Tests

  • internal/suggest/dj_test.go covers, with an in-memory graph:
    • "your vibe" leaves out the other member's artists and uses only the asker's links;
    • "group vibe" credits each member's song;
    • the queue vibe;
    • artists the room turned away;
    • falling back when the graph knows nothing;
    • search-only services.
  • TestProfileNarrow covers the member and queued tastes keeping the room's skips and heard songs.
  • The existing suggestion tests are unchanged and still pass, because they run without a graph.
  • go test -race ./... passes and golangci-lint run ./... reports 0 issues.

🤖 Generated with Claude Code

Search's "keep the vibe going" lists now ask the same DJ as autopilot
when the server has a music graph: the taste profile, the walk through
similar artists, scoring and cross-service matching.

- "Your vibe" narrows the taste to the asker's own (dj.Request.Member);
  "group vibe" uses the room's, members' tastes mixed as for autopilot.
  source=queue reads the taste from the songs playing and waiting
  (dj.Request.Queued), with what played through standing in when nothing
  is queued. What the room heard and turned away stays the room's.
- Picks are found only on the asker's links that search, so every
  suggestion can still be queued by them. Each is credited to the
  member's song it leads from.
- Choose takes a longer list: n picks draw 2n candidates from a shortlist
  at least that long, and look for up to 6 at once on the services, in
  the draw's order (autopilot's two picks try the same candidates as
  before).
- Without a graph, or when it knows nothing near the vibe, the services'
  own recommendations stand in, as before.
- Removed duplicated Finder paths: Finder.Like replaces the
  recommend-or-search branch in suggestions and quick picks, and
  suggest.TrackOf/ArtistKey defer to dj's.
- ADR 0010 and 0012 describe it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@madeofpendletonwool
madeofpendletonwool merged commit 573bfec 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