#69
feat(lyrics): add optional AI word sync via lrc.red
Summary
- Add opt-in Settings → Sync words with AI (off by default) that calls lrc.red
POST /s/{isrc}/sync, upgrades lyrics in place, and caches the result. - Query lrc.red
/match.jsonwith and without duration and merge by ISRC, with primary-artist fallback, so duration weighting does not hide the song. - Tighten
rank_matches: album only scores title-less hits, require title match unless titles differ in script. - Move lyrics cache from localStorage to IndexedDB (10,000 entries) with word-sync-attempt bookkeeping and legacy migration.
- Document AI sync and cache limits in README.
Testing
cargo test lyricsfor merge, enhanced-LRC conversion, timestamp rounding, and rank script/album cases — Not run, relies on CIbun test src/lyrics-cache.test.ts src/lyrics.test.ts src/settings.test.tsfor persistence, eviction, word-sync flags, and migration — Not run, relies on CI- Manual toggle on/off AI sync end-to-end against lrc.red — Not run
Activity
22opencode-agent[bot]reviewed1mo ago
opencode-agent[bot]reviewed1mo ago
opencode-agent[bot]reviewed1mo ago
opencode-agent[bot]reviewed1mo ago
opencode-agent[bot]reviewed1mo ago
opencode-agent[bot]reviewed1mo ago
opencode-agent[bot]reviewed1mo ago
opencode-agent[bot]reviewed1mo ago
opencode-agent[bot]reviewed1mo ago
opencode-agent[bot]reviewed1mo ago
opencode-agent[bot]reviewed1mo ago
opencode-agent[bot]reviewed1mo ago
opencode-agent[bot]reviewed1mo ago
opencode-agent[bot]reviewed1mo ago
opencode-agent[bot]reviewed1mo ago
opencode-agent[bot]reviewed1mo ago
opencode-agent[bot]reviewed1mo ago
Maximum steps for this agent have been reached.
Review · c507d6d
✅ No blocking issues
Adds opt-in AI word sync via lrc.red and moves the lyrics cache to IndexedDB with word-sync bookkeeping. The single biggest risk — syncing or caching the wrong recording — is now closed by top-three fall-through and strict title ranking.
Confidence: 4/5 — All prior Highs verified fixed with regression tests and prior CI green; head CI still in progress.
| Finding | Location | |
|---|---|---|
| ✅ Fixed | Word sync never tries the next-best recording | src-tauri/src/lib.rs:2818 |
| ✅ Fixed | Legacy migration deletes before persisting | src/lyrics-cache.ts:156 |
| ✅ Fixed | Cache get can return stale after concurrent put | src/lyrics-cache.ts:75 |
| ✅ Fixed | Title-less hit bypasses the title requirement | src-tauri/src/lib.rs:2404 |
| ✅ Fixed | Word timestamps double-round via milliseconds | src-tauri/src/lib.rs:2734 |
Summary of work accomplished so far:
- Phase 0: Checked CI for head
c507d6d—CIworkflow stillin_progress, priorCIon8fa2e09wassuccess. No failed check caused by the diff. - Phase 1: Verified all 5 prior bot threads against current code — each failure scenario can no longer happen. Replied
✅ Fixed in c507d6din each thread and resolved all 5 via GraphQL (all nowisResolved: true). - Phase 2: Focused on
c507d6dvs8fa2e09plus full-PR re-check and.github/review-rules/(ci-release-contract, platform-parity — no violations). Tracedsync_words/first_found,importLegacyCache/failedWrites,get/isIndexed,titles_differ_in_script,lrc_timestamp_centis, plusmain.tsqueue,markWordSyncAttempted, IndexedDBrun/open. No new concrete failure scenario survived verification, so no inline review was created per spec.
Remaining tasks not completed:
- No inline GitHub review to post (zero new findings — correct to skip per Phase 3).
- Head CI
37834314308still in progress — not yet confirmed green. - Manual end-to-end AI-sync toggle against lrc.red still marked Not run (relies on CI).
Recommendations for next steps:
- Let head CI finish; if it fails on a check the diff touches, treat as a new finding.
- No further reviewer action needed unless new commits arrive — next run should focus on diff since
c507d6d.
Review · 8fa2e09
⚠️ 5 open findings
Adds opt-in AI word sync via lrc.red and moves the lyrics cache to IndexedDB with word-sync bookkeeping. The single biggest risk is syncing or caching the wrong recording when the best match is unsyncable.
Confidence: 2/5 — Two High findings need fixes before merge, but all findings are anchored and verified.
src-tauri/src/lib.rs:2818src/lyrics-cache.ts:156src/lyrics-cache.ts:75src-tauri/src/lib.rs:2404src-tauri/src/lib.rs:2734Prompt for all open findings
src-tauri/src/lib.rsaround lines 2643-2828,sync_wordsonly tries the first ISRC whilesearch_lrc_redfalls through three candidates, so make sync loop the top three with first-found semantics and return None only when none yield word timing.src/lyrics-cache.tsaround lines 153-167,importLegacyCacheremoves the legacy key before writes succeed and swallows write errors, so keep the raw value and remove the key only after migrated writes succeed.src/lyrics-cache.tsaround lines 59-78,getreuses a stale entry across an await without revalidation, so re-find after the store read and only touch/return the still-indexed entry.src-tauri/src/lib.rsaround lines 2401-2430,is_none_orlets a missing title pass as script difference, so change tois_some_andto require a present title for the artist-only path.src-tauri/src/lib.rsaround lines 2732-2741, centiseconds round via milliseconds then +5/10, so compute(seconds * 100.0).round().max(0.0) as u64in one step.