Skip to content

Deduplicate mixtape generation; unify vibes fuzzy matching with track matcher #340

Description

@joestump

Part of #320. Governing: ADR-0014, ADR-0017, SPEC vibes REQ-VIBES-013 vs SPEC similar-artists REQ-SIM-011. Depends on: #339 (same files), #330 (matcher API). All review CONFIRMED.

Requirements

  • Extract h.generateMixtapeAsync(...): the ~65-line background generation goroutine is byte-identical in albums.go:536 and artists.go:764, and the vibes.go:628 copy has drifted (value captures to avoid stale pointers, TokensUsed > 0 guard, seed persistence) — the drifted copy is the correct one; unify on it
  • Extract parseMixtapeForm(...): the dj_id/GetDJForUser/max_tracks parse block repeats in 5 handlers (albums.go:484, artists.go:711, playlists.go:927, vibes.go:329,422)
  • Unify fuzzy matching: internal/vibes/generator.go:762-888 re-implements normalizeForMatch/similarity/levenshtein/findBestFuzzyMatch from track_matcher.go with real drift (9 vs 33 suffixes; ASCII-only filter drops all non-ASCII letters) — use the track matcher's stack (post-Fix track-matching correctness (rune/byte) and per-tick performance #330 fixes) so AI-track matching behaves like playlist-sync matching
  • Resolve the spec contradiction on prompts: vibes REQ-VIBES-013 forbids hardcoded prompts while similar-artists REQ-SIM-011 requires exactly the fallbackPrompt() pattern generator.go implements — pick a policy, amend the losing spec (coordinate with the contradiction story under EPIC: Spec Governance Cleanup #304)

Acceptance Criteria

  • One generation goroutine implementation, one form parser, one fuzzy-matching stack
  • Behavior parity verified for all three entry points (album, artist, vibes page)

Branch

feature/340-vibes-dedup-unify-matching

PR Convention

PR title references the story; body ends with Closes #340, references the parent epic and governing artifacts above.

🤖 Posted on behalf of @joestump by Claude.

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendGo backend codequeuedIssue is queued for workstoryStory issuetech-debtTechnical debt

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions