Repository navigation
feat(recap): a year summarised from play events (ADR-0156, ADR-0157) - #421
Merged
Merged
Conversation
GET /api/v1/recap/{year}?tz= summarises one profile's play events for the
year in their time zone, clipped to FEEDBACK_TRUSTWORTHY_SINCE and to now,
and states the window it read so a client labels the 2026 recap "since
August 1" from the data. Top tracks, artists and album; minutes listened;
the sound of the year from TrackAnalysis, weighted by play; a 24-hour
listening clock; first listens and favourites added. Fewer than 50
completed plays is `insufficient`, and clients show no recap.
ProfilePlayHistory is never read: it has no dates.
ADR-0157 puts the video on the device, in FamiliarKit, for both the Mac
and the phone; that half lives in familiar-apple.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 of 3 tasks
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
The server half of a Wrapped-style year in review. ADR-0156 and ADR-0157 are both accepted in this PR.
GET /api/v1/recap/{year}?tz=…(tagplays, profile required) summarises one profile's play events for the year in their time zone.FEEDBACK_TRUSTWORTHY_SINCE(2026-08-01) and to now.window_start/window_end, so the 2026 recap is labelled "since August 1" from the data rather than from a hard-coded date.TrackAnalysis: medians weighted by play, the most common key, and the top three mood tags.insufficient. Clients then show no recap at all (ADR-0022 point 3).ProfilePlayHistoryis never read. It has no dates, so it cannot be scoped to a year.familiar-apple, after this merges andscripts/vendor-schema.sh --fetchhas run.The change is additive: the contract stays at version 1, and
openapi.json,contract.lock.jsonandpackages/api-clientare regenerated.Test plan
tests/test_recap.py: 18 tests, covering:erroredfilter fails 7 of the 18 tests.ruff,mypy,lint-contracts,dump_openapi --check,check_contract_bump --check,check_docs.py,api-client checkmake deploy-dev, then check the endpoint's numbers against a SQL count ofplay_eventson the NAS.🤖 Generated with Claude Code