Repository navigation
chore(bot): remove dead track-management service in utils/music - #2276
Conversation
Confirmed via repo-wide grep: zero production importers, direct or via barrel (the utils/music/index.ts barrel that once re-exported it was already deleted separately). Only its own 445-line spec file referenced it. This was #1984's finding, already independently reached the same "genuinely unused" conclusion and closed without the actual deletion landing - #1989's PR body says it was "deliberately left in place" pending a maintainer call. #1968 (the utils/music/ -> services/ split this file was orphaned by) explicitly names this file as in its scope, so making that call here: delete it. Also re-verified #1968's broader state while investigating this: the utils/music/ directory it originally flagged (136 files, 10.5k LOC of misplaced stateful services) is now 34 files / 3535 LOC after prior bounded-slice PRs (#1985-#1989 and others) already moved the DB/API-touching services into services/musicRecommendation/ and services/musicManagement/. Checked every remaining class-based file in utils/music/ for the same pattern (DB access, external API calls, timers/recurring state) that made the original files misplaced - none qualify (search/engineManager.ts's setTimeout is an inline retry delay, not a scheduler; titleComparison/service.ts's Map is a plain in-memory memoization cache). #1968 is functionally complete once this PR merges.
There was a problem hiding this comment.
No issues found across 2 files
Auto-approved: Removes the orphaned TrackManagementService and its spec; the service has no production importers after earlier migration, so this is a bounded dead-code deletion with no behavior change.
Re-trigger cubic
There was a problem hiding this comment.
Graphify reviewed this change.
Looks safe to merge — no coupling regressions and no blocking issues, checked against the code graph (not a self-assessment).
Graphify review — findings
Removes the TrackManagementService unit test suite (service.spec.ts), dropping coverage for constructor option merging, track add/queue management flows, and their error paths.
No blocking issues surfaced. 2 lower-confidence candidates did not survive cross-model review.
Analysis details — impact, health, verification
Impact & health
Graphify review
Impact — 0 functions depend on the 0 functions this change touches.
Health — grade A; no new coupling hotspots.
Verification — 0 functions in the blast radius were not formally verified this run (proofs are advisory here).
Gate & verification
graphify gate
PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.
|
Failed to generate code suggestions for PR |
There was a problem hiding this comment.
Graphify reviewed this change.
Worth a look — the grounded gate found no coupling regressions or blocking issues, but 1 advisory finding(s) below merit a look before merge.
Graphify review — findings
Deletes the TrackManagementService unit test suite (service.spec.ts), removing coverage for queue add/manage behaviour, option merging, and error handling.
Worth a look
- Deleted public TrackManagementService export —
packages/bot/src/utils/music/service.ts:20· Escalate · high- agreed by 2 of 2 members but NOT verified (no proof, no reproducing execution) — consensus is not a verdict; needs human review
Analysis details — impact, health, verification
Impact & health
Graphify review
Impact — 0 functions depend on the 0 functions this change touches.
Health — grade A; no new coupling hotspots.
Verification — 0 functions in the blast radius were not formally verified this run (proofs are advisory here).
Gate & verification
graphify gate
PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.
|



Summary
Closes #1968.
Deleted
packages/bot/src/utils/music/service.ts(TrackManagementService) and its spec. Confirmed via repo-wide grep: zero production importers, direct or via barrel - theutils/music/index.tsbarrel that once re-exported it was already deleted separately. Only its own 445-line spec file referenced it.This was #1984's finding (closed, but the actual deletion never landed - #1989's PR body says it was "deliberately left in place" pending a maintainer call). #1968 explicitly named this file as in its scope, so making that call here.
#1968's broader state, re-verified while investigating this: the directory it originally flagged (136 files, 10.5k LOC of misplaced stateful services mixed into a
utils/folder) is now 34 files / 3535 LOC. Prior bounded-slice PRs (#1985-#1989 and others, all explicitly scoped as "Nth bounded slice of #1968") already moved every DB/API-touching, timer-driven service out toservices/musicRecommendation/andservices/musicManagement/(watchdog.ts,queueResolver.ts,queueStateManager.ts,sessionStartupRestore.ts, thequeue*.tsmutation files, theautoplay/cluster includingreplenisher.ts/candidateScorer.ts,candidateFallback.ts,sessionSnapshots.ts,collaborativePlaylist.ts- all exactly matching the issue's original "suggested approach" destinations).Checked every remaining class-based file in
utils/music/for the same misplacement pattern (DB access, external API calls, timers/recurring background state):search/engineManager.ts's onlysetTimeoutis an inline retry-backoff delay inside a function call, not a persistent schedulertitleComparison/service.ts'sMapis a plain in-memory memoization cache, no DB/API/timerstrackValidator.ts,trackNormalization.ts,searchQueryCleaner.ts,buttonComponents.ts,skipReasonMap.ts, etc.) - matching the issue's own "Keep in utils/" listNone of the remaining files match the pattern that made the original 136-file audit finding real. #1968 is functionally complete with this PR.
Test plan
TrackManagementService/trackManagementServiceoutside the deleted filestsc --noEmitclean across bot/backend/frontend/sharedSummary by cubic
Removes the unused
TrackManagementServicefrompackages/bot/src/utils/music/service.tsand its spec file. It has no production importers (the barrel re-export was already removed), so only its own tests referenced it.Context
services/musicManagement/as part of refactor(bot): utils/music/ (136 files, 10.5k LOC) contains stateful services mislabeled as utilities #1968.utils/music/; none match the misplaced-stateful-service pattern (DB access, API calls, timers), so refactor(bot): utils/music/ (136 files, 10.5k LOC) contains stateful services mislabeled as utilities #1968 is complete with this deletion.tscis clean and the bot suite passes with only the deleted spec's tests gone (250 suites / 3285 tests).Written for commit 900210d. Summary will update on new commits.