From b648307ac5b6c37d800cb8de6583a61b1b20cf50 Mon Sep 17 00:00:00 2001 From: Caleb Allen Date: Fri, 13 Mar 2026 22:22:37 -0400 Subject: [PATCH] docs(12-02): record deferred bulk phantom matching improvement in STATE.md --- .planning/STATE.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.planning/STATE.md b/.planning/STATE.md index d67960a..7ea179a 100644 --- a/.planning/STATE.md +++ b/.planning/STATE.md @@ -132,6 +132,10 @@ Decisions from v1.0 are archived in PROJECT.md Key Decisions table. Key patterns - Orphan cleanup must not delete shared entities across libraries (reference-counting bottom-up) - Existing user migration must be seamless (TOML DirectoryPath to DB libraries table) +### Deferred Improvements + +- **Bulk phantom matching performance** — `FindPhantomMatches` runs 3 sequential DB queries per phantom track (basename search, FTS filename, FTS keywords). With hundreds of phantoms this is O(n×3) round trips. Could batch the basename query (WHERE basename IN (...)), pre-load FTS results, or parallelize with goroutines. Not urgent now that the false-phantom bug is fixed (tracks appeared phantom due to empty library root, not actual missing files). Revisit if users import large playlists from external sources with genuinely unresolved paths. + ### Research Flags - **Multi-library research complete** — see `.planning/research/` (STACK.md, FEATURES.md, ARCHITECTURE.md, PITFALLS.md, SUMMARY.md)