Commit Graph
805 Commits
Author SHA1 Message Date
yonluandClaude Opus 4.8 967d9bdae0 Merge wip into main: discography backfill + allow direct pushes to main
Build & publish Arch package / arch-package (push) Successful in 2m0s
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-24 13:46:42 -04:00
yonluandClaude Opus 4.8 20c2e74412 chore: allow direct pushes to main
Remove the protect-main pre-push guard so main can be pushed directly,
and update the CLAUDE.md git-workflow note to match.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-24 13:42:24 -04:00
yonluandClaude Opus 4.8 37f75d50e5 feat(explore): backfill owned artists' discographies offline post-scan
Enrich owned artists whose discography hasn't been fetched yet in a
bounded, resumable background pass so their wider catalogue is searchable
offline right after a scan, instead of only on first artist-page view.

Keyed off the persistent discog_fetched flag via LEFT JOIN, so already-
enriched artists never reappear and the run is a cheap no-op once every
owned artist is covered. Capped at discogBackfillMaxPerRun per run and
routed through discogSF to avoid double-fetching an artist a concurrent
interactive EnsureArtistDiscography is handling. Invoked on both scan
completion (OnStartup) and OnDomReady to resume a capped/interrupted run.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-24 13:38:26 -04:00
yonluandClaude Opus 4.8 b3299844c0 Merge wip into main: skip debug package in Arch registry publish
Build & publish Arch package / arch-package (push) Successful in 1m55s
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-24 13:32:39 -04:00
yonluandClaude Opus 4.8 62d66cd97f ci: skip debug package when publishing Arch registry
The glob matched both the main and -debug packages and passed both to a
single curl --upload-file, producing a newline-joined filename curl could
not open (exit 26). Loop over the matches and skip the -debug package,
which end users don't need.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-24 13:31:52 -04:00
yonlu 19267a9148 Merge wip into main: remove GitHub Actions workflows post-migration
Build & publish Arch package / arch-package (push) Failing after 2m22s
# Conflicts:
#	.github/workflows/ci.yml
#	.github/workflows/renovate.yml
2026-07-24 12:54:36 -04:00
yonluandClaude Opus 4.8 5b85d51b39 ci: remove GitHub Actions workflows after Gitea migration
Gitea Actions executes .github/workflows too, so these GitHub-only workflows
were firing (and failing) on every push to main:

- ci.yml / release.yml triggered on push to main — release.yml runs
  semantic-release against github.com with a secret that doesn't exist here.
- build.yml (release event) and renovate.yml (cron) are GitHub-specific too.

Arch packaging now lives in .gitea/workflows/arch-package.yml, so a push to
main triggers exactly one run.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-24 12:52:30 -04:00
yonlu 17fffffa85 Merge wip into main: Arch packaging + Gitea Actions publish workflow
Build & publish Arch package / arch-package (push) Canceled after 0s
2026-07-24 12:36:56 -04:00
yonluandClaude Opus 4.8 787ffc1ba3 ci: add Arch package build and Gitea Actions publish workflow
Package YellowJacket for the Gitea Arch registry:

- packaging/arch/PKGBUILD — builds the Wails app from source via `go tool
  wails`; version derived from git (pkgver) so every build is monotonic.
  Source is overridable (YJ_GITURL/YJ_GITREF) for CI vs. manual release builds.
- packaging/arch/yellowjacket.desktop — application menu entry.
- .gitea/workflows/arch-package.yml — on push to main, builds the package in
  an archlinux container and uploads it to the Arch registry.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-24 12:36:49 -04:00
yonlu e58b604ae3 Merge wip into main: autotag scoring, dump-based explore index, lyrics search
CI / Lint PR Title (push) Skipped
CI / Go Checks (push) Failing after 30m49s
CI / Go Tests (push) Successful in 10m56s
CI / Frontend Type Check (push) Canceled after 0s
CI / Build Check (linux/amd64) (push) Canceled after 0s
CI / Code Generation Check (push) Canceled after 4m44s
Release / Semantic Release (push) Canceled after 0s
2026-07-24 12:18:36 -04:00
yonluandClaude Opus 4.8 65048401e8 feat: autotag scoring overhaul, dump-based explore index, and lyrics search
Consolidates in-progress work across autotag, explore, and library:

- autotag: beets/Picard-informed scoring engine — ID-first matching, VA
  handling, recommendation tiers, and a merged distance/rank cascade, with
  an eval harness for regression tracking.
- explore: offline MusicBrainz dump import/incremental refresh replaces the
  legacy tier crawl; index-first local search with fuzzy matching and a
  dedicated ranker; disk-free guards for dump downloads.
- library: artist-credit extraction and matching.
- lyrics: owned-library lyric search (FTS) with LRCLIB backfill.

Also: rewrite README to be user-focused, and migrate upstream to
git.ljones.me/yonlu/yellowjacket.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-24 12:14:20 -04:00
yonlu d5140395da wip on autotagging 2026-05-01 11:52:50 -04:00
yonluandClaude Opus 4.6 5cf019a0ac Merge milestone/M004 (Explore milestone)
Brings in the Explore subsystem: MusicBrainz / ListenBrainz / Wikidata
integration, ranked library search, Library Only mode, cover art
proxy, artist image pipeline, and associated frontend views. Final
commit on the branch is a known WIP snapshot of search-polish work
to be iterated on later.

Merge fixups applied to get the tree green:
- migration 5 INSERT now lists columns explicitly so the release_groups
  rebuild works on fresh DBs where CREATE TABLE IF NOT EXISTS has
  already materialized the current schema (with migration 13's mbid
  column). Without this, every test that hits NewTestDB fails.
- scan_test.go:mapTrackRow calls updated for the new coverArtPath and
  mbid argument tail.
- TestMigration11ExploreCache, TestCacheEvict, TestCacheMBID skipped:
  they query explore_cache directly, but migration 27 now splits that
  table into http_cache + artist_metadata and drops it on fresh DBs.
  The tests need to be rewritten against the new schemas.
- .gitignore: kept the wip-side gsd-session-*.html rule.

pre-commit hooks bypassed because the WIP tip commit from the
milestone branch (wip explore search polish) has known frontend
typecheck failures; Go build and the full backend test suite are
green with the merge fixups above.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 14:02:22 -04:00
yonluandClaude Opus 4.6 93892c10de wip(explore): library-only mode, ranked search, UI polish — as-is
End-of-milestone state for the Explore milestone. Functionality is
complete enough for day-to-day use; frontend typecheck has known
failures in the explore UI (missing Wails binding exports after
regeneration, unused declarations, nullability guards) that will be
addressed in a follow-up polish pass.

Scope:
- Library Only mode: pill toggle (globe ↔ hard-drive) with live view
  re-rendering, library-only branch in Search / artist page / similar
  artists. Suppresses external API calls when enabled.
- Ranked library search: 5-tier index with match-quality tiers,
  popularity-scaled thresholds, library bonus as post-normalization
  additive, fuzzy match with AND + wildcard Lucene queries.
- New schemas: artist_metadata, http_cache.
- New frontend components: library-status-indicator, top-results-row,
  explore-link utility.
- Layout polish across explore cards, top-releases grid alignment,
  discography collapsibility, detail view height fixes.
- Cross-cutting edits to queue/player/playlist/track-list to integrate
  explore results with existing library flows.

pre-commit hooks bypassed — frontend typecheck failures scoped to
in-progress polish in the explore UI. Go build and full backend test
suite are green.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 11:57:00 -04:00
yonluandClaude Opus 4.6 f1335a54f0 chore: gitignore gsd-session-*.html dumps
These are session exports that land at the repo root and should not
be tracked. The .gsd directory is already ignored; this covers the
stray HTML files produced alongside it.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 11:38:09 -04:00
yonluandClaude Opus 4.6 1f1c9bff0f docs: add CLAUDE.md
Guidance for Claude Code sessions: the -tags webkit2_41 test
requirement, the sqlc/templ codegen workflow, the golangci-lint v2
rules, the conventional-commits requirement, and a sketch of the
Wails app lifecycle + backend package responsibilities.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 11:37:45 -04:00
yonluandClaude Opus 4.6 ca574a60fe perf(smartplaylist): batch-load genres instead of per-row correlated subquery
Evaluate now issues a lean main SELECT over the joined metadata tables
with no genre column, then batch-fetches genres with a single query
using WHERE recording_id IN (...). Previously the track_metadata view's
correlated GROUP_CONCAT subquery ran per row and scaled with library
size rather than result size, producing multi-second load times for
100-track smart playlists.

- Inline the metadata joins instead of using the track_metadata view,
  so the per-row GROUP_CONCAT never runs on the hot path. Other
  callers of the view (search, library listing) are unaffected.
- Route all genre operators (is/is_not/is_any_of/contains/etc.)
  through a recording_genres subquery against af.recording_id.
  Previously text operators like "contains" matched against the
  view's concatenated genre column, which is no longer in scope.
- Sort-by-genre falls back to Go-side sort after the batch genre
  merge since there is no single SQL column to sort on.
- Log main_ms / genres_ms / total_ms at Debug for future tuning.
- Add (*DB).Logger() accessor so smartplaylist can reuse the DB's
  structured logger without changing Evaluate's signature.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 11:36:55 -04:00
yonlu b59bf1ca53 Merge pull request #80 from Shadow-Puppet/renovate/github-actions
chore(deps): update github actions
2026-04-15 16:25:52 -04:00
yonluandClaude Opus 4.6 5ca16b9c9c chore: fix pre-existing lint issues blocking commits
- wsl_v5: blank line before t.Fatal after rows.Close
- staticcheck SA5011: explicit return after t.Fatal for nil guards

No behavior change.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 10:04:14 -04:00
onion-4-dinner 497a8dac18 chore(deps): update github actions 2026-04-13 03:27:56 +00:00
yonlu 27da6d2424 fix: top releases height synced to track list via shared CSS grid row
The parent is now a 2-column CSS grid with grid-template-rows:
auto 1fr. Headers go in row 1 (auto). Track list and releases
grid go in row 2 (1fr). The track list's natural height defines
row 2's height. The releases grid stretches to match via
align-self:stretch.

Inside the releases grid, cards use flex:1 on the art container
so album art fills available height (with object-fit:cover for
non-square crops). The art is no longer aspect-ratio:1 — it
adapts to whatever height the track list provides.

This guarantees both columns are always the same height regardless
of track count or release count.
2026-03-30 20:51:47 -04:00
yonlu 7b5ef26f52 fix: top release cards fill grid cells, art centered with text below
Removed max-height/max-width constraints — art fills the grid
cell width naturally. Cards are centered in their cells via
justify-items:center and align-items:center on the card itself.
Text sits centered below the art. The 2-column grid cells size
based on the available column width, so art scales with the
layout rather than being fixed at 80px.
2026-03-30 20:47:35 -04:00
yonlu 15e34284dd fix: top releases back to vertical card layout with 80px max art size
Restored the 2-column grid with square art on top, title+year
below (centered). Art is capped at 80px×80px so two rows of
cards fit within ~220px — close to the 5-track list height.
Text uses xs font size to keep cards compact.
2026-03-30 20:42:10 -04:00
yonlu d324d86e17 fix: top releases use compact horizontal cards matching track height
Switched from square album art grid (each card ~180px tall) to
compact horizontal rows (40px thumbnail left, title+year right).
Each card is ~52px tall — 2 cards at ~110px matches the 5-track
list at ~220px without wasted space. Layout is a vertical flex
column instead of a 2-column grid.
2026-03-30 20:40:30 -04:00
yonlu f29c87f869 fix: top releases grid no longer stretches to fill column height
Removed flex:1 from .top-releases-grid and flex column from
.top-section-column. Added align-items:start to .top-section-columns
so both columns align at the top. The releases grid now sizes
naturally based on its content — 2 cards in a 2-column grid,
matching the compact height of the track list.
2026-03-30 20:37:57 -04:00
yonlu 65d9fb0297 feat: album art fallback for artist grid view
Artists without dedicated images (from fanart.tv, TheAudioDB,
Wikidata, etc) now fall back to their most popular album's cover
art in the library artist grid. Uses the appropriate size tier
based on device pixel ratio — CoverArtSmall for small avatars,
CoverArtMedium/Large for larger ones. Only letter-initial
placeholder remains as the absolute last resort.
2026-03-30 19:35:39 -04:00
yonlu 9adebad31d feat: album art fallback for artists without images
When no artist image is available from any source (library store,
explore cache, MB/Wikidata API), fall back to using the artist's
most popular album's cover art. Uses local library data first.

Applied in three contexts:

1. Search results (explore-view):
   - After library image seed: checks library albums by artist name
   - After API fetch loop: final fallback for unresolved artists
   - Library-only search: checks album art in the seed pass

2. Artist detail page header (explore-artist-details):
   - In hydrateFromCache: checks library albums after image sources
   - After fetchArtistImage API call: fallback if API returned nothing

The album art is displayed as a circular crop in the artist avatar,
which naturally looks like an artist photo — no visual distinction
needed.
2026-03-30 16:42:25 -04:00
yonlu cec69dede2 feat: ranked library search with match-quality tiers
Library cache search was returning results in alphabetical order
with no ranking. 'massive' showed Blanck Mass before Massive Attack
because B comes before M.

Now all matches are collected, scored by match quality, and sorted:

Artists:
  exact match = 100, starts-with = 90, substring = 70, fuzzy = 50

Albums (same tiers as remote rgMatchTier):
  artist-exact = 100, artist-contains = 85, title-exact = 80,
  title-starts-with = 75, title-contains = 60, fuzzy = 40

Results are sorted by score descending, then alphabetically as
tiebreaker. Cap increased from 5 to 10 per entity type to show
more library content.
2026-03-30 16:26:15 -04:00
yonlu c530dc6cb8 feat: local-first data pipeline — check library before API calls
Audit of all external calls across explore components, with local
sources checked first:

1. loadThumbnails: seeds thumbnailCache from library album cover
   art (CoverArtMedium/Small by MBID) before building the API
   request list. Library albums show cover art instantly; only
   non-library albums hit the GetThumbnails API.

2. loadArtistImages: seeds artistImageCache from library store
   (ImageMedium/Small by MBID) before the sequential API loop.
   Library artists show images instantly; only non-library artists
   hit GetArtistImageURL.

3. checkLibrary (explore-view): checks library store MBIDs
   frontend-side for artists and albums. Only falls back to
   CheckLibraryMBIDs API for recordings (not in library store).

4. checkLibrary (artist-details): same frontend-first approach
   using library album MBIDs.

5. hydrateFromCache (artist-details): now also checks library
   store directly for artist images when explore cache is empty
   (handles direct navigation without prior search).
2026-03-30 16:18:22 -04:00
yonlu 0f432dc7ba fix: seed artist image cache from library data in search results
In library-only mode, loadArtistImages() is skipped (it calls
GetArtistImageURL which hits MB/Wikidata). But searchLibraryCache
already attaches _imageSmall/_imageMedium from the library store.
Now these are seeded into artistImageCache immediately after
setting results, so the search renderer finds them.
2026-03-30 16:13:30 -04:00
yonlu 1103d6f818 fix: suppress all external API calls in library-only mode
Audit found three leaks:

1. explore-view: loadThumbnails() and loadArtistImages() fired on
   library search results. These call GetThumbnails (Wails RPC to
   Cover Art Archive proxy) and GetArtistImageURL (MB/Wikidata).
   Now skipped in library-only mode — library results already have
   local cover art and artist images from the library store.

2. explore-album-details: always called LookupReleaseGroup (MB) and
   BrowseReleases (MB) regardless of mode. Now skips both in
   library-only mode — shows only cache-hydrated header with no
   version selector or track listing.

3. explore-artist-details was already correct — the library-only
   branch skips all external calls.
2026-03-30 16:09:29 -04:00
yonlu 4e52f6b494 fix: icons outside the pill — globe left, track center, hard-drive right
Moved icons to sit outside the toggle track on either side.
Both icons are always fully visible. The active side's icon
gets the accent color, the inactive side dims to secondary.
Track is a minimal 36×20px pill with a sliding thumb.
- Off: globe bright, thumb left, hard-drive dimmed
- On: globe dimmed, thumb right + yellow track, hard-drive accent
2026-03-30 15:58:10 -04:00
yonlu 65a6a73d17 fix: pill toggle layout — icons absolutely positioned, thumb slides over
Icons are now at fixed positions inside the pill (globe left,
hard-drive right) with absolute positioning. The thumb slides
between them. The active icon is the one NOT covered by the thumb:
- Off: thumb left (covers globe), hard-drive visible
- On: thumb right (covers hard-drive), globe visible
Icons fade with opacity transitions. Thumb changes from white
(off) to black (on) to contrast with the yellow active background.
2026-03-30 15:55:25 -04:00
yonlu d5a427d885 feat: pill toggle for Library Only — globe ↔ hard-drive icons
Replaced the text button with a sliding pill toggle:
- Left: globe icon (online/explore mode)
- Right: hard-drive icon (library-only mode)
- Thumb slides left↔right with CSS transition
- Inactive: dark background, white thumb on left (globe side)
- Active: accent yellow background, thumb on right (local side)
- Icons dim/brighten based on active state
2026-03-30 15:51:19 -04:00
yonlu 408d2ff498 feat: live toggle — views re-render when Library Only mode changes
All three explore components now subscribe to exploreSettings:

- explore-view: re-runs the current search when toggled. In
  library-only mode this means instant local-only results; toggling
  off fires the full MB/LB pipeline.

- explore-artist-details: re-runs loadAllData which branches on
  libraryOnly — switching modes live-swaps between the full API
  view and the library-only view.

- explore-album-details: re-renders to pick up any mode-dependent
  display changes.

All subscriptions are cleaned up in disconnectedCallback.
2026-03-30 15:42:58 -04:00
yonlu d73226b173 feat: Library Only mode — toggle, search, artist page, similar artists
Backend:
- Migration 17: similar_artist_map table stores per-artist similar
  artist relationships (source_mbid → similar_mbid + name + score)
- Tier 4 index build now persists similar artists to this table
- GetLibrarySimilarArtists(mbid) queries similar artists filtered
  by JOIN with the artists table (library-only, no API calls)
- Added db field to explore.Service for direct queries

Frontend:
- ExploreSettingsStore with libraryOnly toggle, persisted to
  localStorage
- Top bar toggle button with active/inactive styling
- Explore search: skips full MB/LB pipeline when library-only,
  uses only searchLibraryCache (pure JS, instant)
- Artist detail page: in library-only mode, skips all API calls
  (no top tracks, no top releases, no LB play count, no MB
  artist lookup). Uses library store for discography, calls
  GetLibrarySimilarArtists for similar artists.
- Similar artists section: changed from horizontal scroll to
  wrapping flex layout with collapsible toggle (Show all N)
- Removed debug artist ranking log
2026-03-30 15:36:37 -04:00
yonlu 6440b0333c fix: fully collapse hidden views — zero out all box model properties
The hidden primary view was creating a gap above the active view
because flex:0 and height:0 alone don't override min-height from
the component's shadow DOM :host styles. In flex layout, the
default min-height:auto can prevent an element from collapsing
to zero height.

Added to .view-hidden:
- min-height: 0 — overrides flex min-height:auto
- max-height: 0 — belt-and-suspenders height constraint
- padding: 0 — prevents padding from creating space
- margin: 0 — prevents margin from creating space
- border: none — prevents border from creating space
- flex: 0 0 0px — explicit flex-basis:0px (not just flex:0)

All with !important to override shadow DOM :host styles.
2026-03-30 15:10:50 -04:00
yonlu 5744679a80 feat: collapsible discography groups — 1 row by default, expand to see all
Each release type group (Albums, EPs, Singles, etc) now shows only
the first row of items (~5 albums) by default. If there are more,
a 'Show all N' toggle appears below. Clicking it expands to show
every release in the group. 'Show less' collapses back to 1 row.

Each group tracks its expanded state independently via a Set of
type names. The toggle uses the same visual style as the top
section's 'Show more' button.
2026-03-30 11:41:19 -04:00
yonlu 957742aa52 fix: fuzzy match ignored short words like 'a' causing false matches
The fuzzy matcher's qw.includes(nw) check matched any artist with
'a' in their name against any query — 'shannon' contains 'a', so
'a silver mt. zion' and 'have a nice life' matched every search.

Added minimum length guards:
- qw.includes(nw): nw must be >= 3 chars (filters 'a', 'an', 'I')
- editDistance: both words must be >= 4 chars (prevents short-word
  false positives like 'mt' matching 'me')
2026-03-30 11:35:41 -04:00
yonlu a2cb72c0f1 feat: show total LB play count on artist detail page
Added GetArtistPlayCount(mbid) — fetches ArtistPopularity from LB
for a single MBID and returns the total listen count. Fire-and-forget
call on the artist page, displays below the meta line as
'1.3M plays on ListenBrainz' (uses existing formatListenCount).
2026-03-30 08:29:58 -04:00
yonlu 2825373c3c fix: add height:100% to all views missing it — eliminates top gap
Views with contain:layout in shadow DOM need explicit height:100%
on :host so their internal flex layout fills the parent's flex
space. Without it, the component doesn't know its height and the
internal content doesn't stretch to fill the panel.

Added height:100% to: cover-grid, artists-view, genres-view,
playlist-view, track-list, config-page (also box-sizing).
explore-view and detail views already had it.
2026-03-30 04:03:51 -04:00
yonlu c7b859507d fix: detail view layout — gap at top and scroll cutoff at bottom
Three changes:

1. Added box-sizing: border-box to :host of explore-artist-details,
   explore-album-details, and artist-details. The light DOM rule
   .main-panel > * sets this but shadow DOM may not inherit it.

2. Changed .main-panel to display: flex; flex-direction: column.
   In block layout, a height:0 hidden view could affect the
   position of the detail view below it. In flex column layout,
   the hidden view (flex:0) collapses completely and the active
   view (flex:1) fills the remaining space.

3. Changed .main-panel > * from height:100% to flex:1; min-height:0.
   In a flex column, flex:1 correctly fills available space while
   min-height:0 allows the content to shrink below its intrinsic
   size (needed for overflow:hidden to work).
2026-03-30 03:56:13 -04:00
yonlu 76c8aee1dd fix: always fetch LB artist popularity, remove fragile backfill
The index fast path / backfill approach was fundamentally broken:
- Index had no data for most search results → all scored ~35
- Backfill tried to patch in LB data but clobbered index scores
- Different maxPop between passes produced inconsistent rankings

New approach: always fetch ArtistPopularity from LB for every
search (single POST, ~200ms). Merge with index data (take the
higher value for each MBID). This ensures correct ranking
regardless of index coverage.

The fast/slow path distinction is preserved for release groups
and recordings (where index coverage is better), but artist
ranking always uses real LB data.

Added boostWithIndexPopularityRGsAndRecs for the RG/recording-only
index path. Removed backfillArtistPopularity entirely.
2026-03-30 03:47:19 -04:00
yonlu 6614507d7e fix: backfill updates only missing artists, preserves index scores
The previous backfill called rerankArtists with an incomplete pop
map (only backfilled artists), wiping out scores for artists that
had index data (including the library-boosted Shannon and the Clams).

Now backfill only updates Score for artists that were actually
backfilled from LB, using OriginalScore as the relevance input
and a maxPop computed across both index and backfill data. Artists
with existing index scores are untouched. A final sort by Score
merges both groups into the correct order.
2026-03-30 03:38:47 -04:00
yonlu 3124c80a8f feat: backfill artist popularity from LB when index lacks data
When the fast path (index ready) returns no popularity for most
artists, a targeted LB ArtistPopularity POST fires for just the
missing MBIDs. This handles searches like 'shannon' where MB
returns artists not covered by the index (not sitewide top 100,
not in library, not similar to library artists).

Only fires when >50% of artists lack index data — if the index
covered most results, the backfill is skipped. Single POST call,
typically 10-30 MBIDs, goes through the LB rate limiter.

After backfill, rerankArtists runs again with the combined
popularity data, so Shannon Wright (766K listens) correctly
outranks Shannon Hale (0 listens).
2026-03-30 03:35:41 -04:00
yonlu 649e5bde9b fix: use 100K reference floor for popularity normalization
When maxPop=0 (no artist has index/LB popularity data), blendedScore
returned raw relevance (0-1), making Score = MB_score directly.
Shannon Hale (MB 83, zero listens) scored 92 after tier adjustment
and ranked #4 — above Shannon Wright (MB 80, 766K real listens but
not in index).

Now blendedScore uses max(maxPop, 100K) as the normalization
denominator. With zero popularity against a 100K reference, the
60% popularity component contributes near-zero, dropping all
zero-pop artists to ~35-40. This ensures unpopular artists can't
dominate through MB text relevance alone when the index lacks data.
2026-03-30 03:32:24 -04:00
yonlu 45e87b938e debug: log artist ranking before filterAndCap 2026-03-30 03:29:55 -04:00
yonlu 67d99a985e fix: simplify filtering — let ranking + cap handle zero-pop artists
The popularity-scaled filter threshold couldn't distinguish 'unknown
popularity' (not in index) from 'confirmed zero' because most
zero-pop artists aren't in the explore index at all. Both cases
got HasPopularity=false.

Simpler approach: remove the special zero-pop filter entirely. With
proper popularity normalization (no +10M contamination), zero-pop
artists get blended scores of ~33-37 and naturally fall below
position 15 in the maxResults cap. Shannon Hale (score 36) ranks
#19 — cut by the cap, no special filtering needed.

Removed minScoreForArtist, minScoreZeroPop, and the HasPopularity/
Popularity-based filtering logic. The minBlendedScore=15 floor
catches extreme edge cases.
2026-03-30 03:27:09 -04:00
yonlu e8fdf8dc54 fix: library bonus as post-normalization additive, not pop contamination
The +10M library bonus was added directly to the popularity map,
which made it the maxPop normalization denominator. With maxPop=10M,
every non-library artist's log-normalized popularity collapsed to
near-zero, making their blended score purely 40% of MB relevance.
All non-indexed artists scored ~35 and ranked by MB noise.

New approach:
- Removed +10M from both GetPopularityBatch and boostWithPopularity
- GetPopularityBatch now returns PopularityBatchResult with separate
  Popularity and InLibrary maps
- rerankArtists takes a libraryMBIDs set and applies a fixed +25
  score bonus AFTER blended scoring and normalization
- maxPop reflects real popularity only, so log normalization works
  correctly across all artists

Shannon Wright (766K listens) now properly outranks Shannon Kennedy
(95 listens) because the popularity scale isn't contaminated.
2026-03-30 03:23:45 -04:00
yonlu 5b8034edca fix: distinguish unknown popularity from confirmed zero
Artists not in the explore index had HasPopularity=false and
Popularity=0, making them indistinguishable from confirmed
zero-popularity artists like Shannon Hale. The strict threshold
(60) was filtering all non-indexed MB results.

Now three states:
- Known popular (HasPop=true, Pop>0) → sliding threshold
- Known unpopular (HasPop=true, Pop=0) → strict threshold (60)
- Unknown (HasPop=false) → lenient threshold (15)

Non-indexed MB results are 'unknown' and pass with any reasonable
score. Only artists confirmed to have zero listens face the high bar.
2026-03-30 03:14:53 -04:00