feat: detect & link album mentions, not just artists (closes task/album-detection)

Source: task/album-detection (objective/linker-improvements) — project brief asks for artist OR album linking; MVP linked artists only.

- service/lib.js: pickAlbum (the exact-name gate, named for the album path) + linkResult now carries kind:"artist"|"album" (additive; defaults to artist so older clients keep working).
- service/resolver.js: one Spotify type=artist,album search per candidate, exact-match against either; returns {url,kind}; cache key includes the kind hint. resolveOne/resolveAll thread the LLM kind hint through.
- service/llm.js: parseClassification now returns Map(name -> "artist"|"album") so album-kind candidates route to the album path (.has() still works like the old Set).
- extension/extract.js: albumMatchesIn over two precise signals (quoted strings + album cue phrases "the album X", "X LP/EP"), folded into allMatchesIn.
- extension/content.js + styles.css: album links render italicised (.rsl-album) with an album tooltip; artist behavior unchanged.
- Tests: new pure-logic coverage in lib.test.js / llm.test.js / extract.test.cjs (album shaping, Map-kind routing, album candidate extraction). scripts/check.sh green.
- README.md + AGENTS.md: document album linking.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
paul
2026-06-22 22:33:32 +00:00
co-authored by Claude Opus 4.8
parent ef57761859
commit 2b4babf955
11 changed files with 243 additions and 83 deletions
+7 -2
View File
@@ -1,10 +1,15 @@
/* Injected links — kept subtle so reddit comments stay readable. One link per artist,
coloured by platform: green = Spotify, blue = Google (bandcamp-search fallback). */
/* Injected links — kept subtle so reddit comments stay readable. One link per artist/album,
coloured by platform: green = Spotify, blue = Google (bandcamp-search fallback). Album links
are italicised (the usual title convention) so an album reads differently from an artist at
a glance; the platform colour is unchanged. */
.rsl-link {
text-decoration: underline dotted;
text-underline-offset: 2px;
cursor: pointer;
}
.rsl-album {
font-style: italic;
}
.rsl-spotify {
text-decoration-color: #1db954 !important; /* spotify green */
}