Repository navigation
feat(recap): place the year's sound within the library (ADR-0156) - #423
Merged
Merged
Conversation
The analysis scores this library high on energy and valence and low on danceability throughout (library medians 0.83, 0.85, 0.15 on the NAS), so a raw median of 0.85 energy says "typical", not "energetic". Each median now also comes with its percentile rank among every analysed track, ties counted as half, so a slide can say "calmer than your library". Additive; contract stays at v1. 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
For each of the year's sound medians (
bpm,energy,valence,danceability),sound.library_percentileadds its percentile rank among every analysed track in the library, 0–100, with ties counted as half.The raw medians can't stand on their own. On the NAS, the analysis scores the whole library at median energy 0.83, valence 0.85 and danceability 0.15, so "0.85 energy" means "typical", not "energetic". A slide can say "calmer than your library" from the percentile.
It's one aggregate query over
track_analysis. The change is additive, the contract stays at v1, andopenapi.json,contract.lock.jsonand the generated client are regenerated. ADR-0156's Implementation block records it.Test plan
tests/test_recap.py: 21 pass. The new test pins the arithmetic: below, the track itself counted as half, everything level → 50, and no median →None.ruff,mypymake deploy-devand read the percentiles for the real profile🤖 Generated with Claude Code