Make the artist a gate, not a quarter of the score

Requesting "Michael Jackson - Chicago" filed The Fall's "Chicago, Now!" from
Extricate. The chain: the artist name is filtered by the Soulseek server, so
the ladder correctly fell back to the bare title -- at which point the result
set is every song anyone has ever called Chicago, and the artist is the only
thing telling them apart.

match_ratio weights the artist at 0.25, so a perfect title with no artist
anywhere scores 0.75. That clears MIN_MATCH, and the ~22 point gap it leaves
against a genuine match is nothing next to the 340 points score() awards for a
free upload slot and a short queue. An idle peer holding the wrong song
therefore beat a busy peer holding the right one, every time.

That is the failure the confidence score was explicitly designed to prevent --
"a fast peer must not be able to raise the confidence of a wrong match" -- and
rewriting score() to rank availability first reintroduced it on the other side
of the wall. Availability is a tiebreak among plausible files; it is never a
reason to take a different song.

Candidates whose path names the artist are now kept outright and the rest
discarded, falling back to title-only matches only when there are none. The
downstream confidence gate still ran correctly here: it scored 0.75, said
"artist not found in path", and held the file for review.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Aryan SinghandClaude Opus 5 committed 2026-09-02 14:10:34 -05:00
1 parent f0c5b5af00
commit 5b17d5fc8d
3 files changed
+85 -3

No files matched your search

+18 -3
View File
@@ -218,9 +218,24 @@ and finally the artist itself. Since most requests are answered by the first
query, the extra searches cost nothing in the common case — `MUSE_MAX_QUERIES`
caps how far it will go.
Dropping the artist from the *query* does not mean ignoring it. The artist is
then matched against the whole **folder path**, which is where a well-organised
share puts it anyway:
Dropping the artist from the *query* does not mean ignoring it — it makes the
artist matter more. A bare-title search stops returning "this song from various
peers" and starts returning *every song anyone ever called Chicago*: The Fall,
Groove Armada, Sufjan Stevens. The artist is then the only thing separating the
right recording from a different song entirely, so it is a **gate**: candidates
whose path names the artist are preferred outright, and ones that do not are
used only when nothing else is left.
That has to be a gate rather than a weighting, and the reason is worth stating.
A perfect title with no artist scores 0.75, comfortably above `MUSE_MIN_MATCH`,
so as a mere contribution it loses to availability — and an idle peer holding
the wrong song beats a busy one holding the right song. That is not
hypothetical either: it filed The Fall's "Chicago, Now!" as Michael Jackson.
The same principle the confidence score is built on applies here: a fast peer
must not be able to promote a wrong match.
The artist is matched against the whole **folder path**, which is where a
well-organised share puts it anyway:
```
anjya music/Michael Jackson/1982 - Thriller [flac]/06 - Billie Jean.flac