Skip to content

docs: Recently Played (frecency) design + US-PLAY-10 + S10.6#56

Merged
ramith merged 1 commit into
mainfrom
docs/recently-played-frecency-design
Jul 14, 2026
Merged

docs: Recently Played (frecency) design + US-PLAY-10 + S10.6#56
ramith merged 1 commit into
mainfrom
docs/recently-played-frecency-design

Conversation

@ramith

@ramith ramith commented Jul 14, 2026

Copy link
Copy Markdown
Owner

Design + doc updates for reworking the S10.2 History tab into an all-time, per-track, frecency-ranked "Recently Played" view (fixes the duplicate-row-on-replay complaint by construction). No code yet — implementation follows the architect/the-fool gate.

Founder-locked knobs (brainstorm 2026-07-14)

  • All-time persistent · a play = ≥60% heard, ~4-min cap, cumulative heard-time · frecency sort, 7-day half-life · renamed Recently Played.

Design highlights (architect-reviewer + swiftui-pro)

  • Data model: a decayed-score accumulator column frecency_score (schema v4) — chosen over a naive count×decay (violates recency>count) and a per-play events table (unbounded); O(1) and mathematically equal to summing per-play decays. play_count/last_played unchanged. One registered GRDB decay function drives write + read.
  • ≥60% rule: cumulative heard-time in the transport tick (rejects scrub-to-preview), extracted into a pure PlayThroughTracker for unit tests.
  • UX: dedicated RecentlyPlayedRow (LibraryTrackDisplay), "N plays · 2h ago" legibility cue, tap = play-now. Deletes the in-memory session log.
  • QA plan: VerifyLibraryStore FR-checks (counters, burst-vs-spread, recency-outweighs-count, never-played-excluded, tiebreak, pagination, move-preserves-state) + PlayThroughTracker swift-testing.

⚠ Flagged (D8)

eraseDatabaseOnSchemaChange → the v3→v4 bump resets current play counts once, and counts persist only until the next schema bump pre-R1. Accepted (matches the no-migration posture); "preserve play-state columns across schema change" logged as an R1 durability requirement.

Files

New: recently-played-frecency-design.md. Edits: backlog (US-PLAY-10), sprint-plan (S10.6 + §Status), s10 plan, roadmap.

🤖 Generated with Claude Code

Reworks the S10.2 History tab into an all-time, per-track, frecency-ranked
'Recently Played' view. Design vetted by architect-reviewer + swiftui-pro; founder
brainstorm locked the four knobs (half-life 7d; ≥60%-heard capped at ~4min;
cumulative heard-time; rename to 'Recently Played').

- docs/sprints/recently-played-frecency-design.md (new): the full design + QA plan.
  Data model = a decayed-score accumulator column (frecency_score, schema v4) —
  chosen over both a naive count×decay (violates recency>count) and a per-play
  events table (unbounded); mathematically equal to summing per-play decays at O(1).
  ≥60% rule extracted into a pure PlayThroughTracker (unit-testable). Full delete of
  the in-memory session log (kills the dup-row bug by construction).
- backlog.md: new US-PLAY-10 (Recently Played).
- sprint-plan.md + s10 plan: add S10.6 (5 SP, enhancement — NOT an R1 gate); §Status
  now 'S10.6 in design → then S10.4'.
- roadmap.md: S10 line notes recently-played (frecency).

D8 flagged: the v3→v4 bump resets current play counts ONCE (eraseOnSchemaChange);
'preserve play-state columns across schema change' logged as an R1 durability req.

No code yet — design + docs only; implementation follows the architect/the-fool
gate.
@ramith
ramith merged commit 2aad201 into main Jul 14, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant