Repository navigation
fix(recap): first listens, mood words and artist spelling (ADR-0156) - #422
Merged
Merged
Conversation
Found on the first run against the NAS, whose totals otherwise matched a
SQL count exactly (2,066 plays, 9,773.2 minutes):
- first_listens counted skipped tracks too, and came out larger than
unique_tracks (1,457 against 1,322). It now counts tracks played
through, so it is a subset.
- The sound's mood words counted every category in mood_tags, so a year
of Interpol and Boards of Canada read "blues, rock, country". Only
category "mood" counts now.
- Top tracks showed the file's artist tag ("Boards Of Canada") beside the
canonical name on the artists slide ("Boards of Canada").
The ADR records a fourth finding: the library-wide medians of energy and
valence are 0.83 and 0.85, so the raw medians are not absolutes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
These come from the first run of #421 against the NAS. Its totals matched a SQL count exactly (2,066 plays, 9,773.2 minutes since Aug 1), but three things a slide would show were wrong:
first_listenscounted skipped tracks, so it came out at 1,457 against 1,322unique_tracks. It now counts only tracks played through, which makes it a subset.mood_tagscategory. Genre, instrumentation and energy tags share that field, so the year read "blues, rock, country". Onlycategory == "mood"counts now.ADR-0156's Implementation block records these, plus one finding left for the client to handle: the library-wide medians are energy 0.83, valence 0.85 and danceability 0.15, so the raw "sound" medians aren't absolutes.
No schema change. The new
artist_idis internal to the service and isn't in the response.Test plan
tests/test_recap.py: 20 pass. The new and changed tests (canonical spelling, mood category, skipped tracks aren't first listens) each fail againstmain'srecap.py.ruff,mypy,dump_openapi --check,check_docs.pymake deploy-devand re-run the NAS check🤖 Generated with Claude Code