Repository navigation
refactor: cut about 160 lines of pass-through layers, unused options and duplicate commands - #11
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
…mmands The auto engine forwards playback in one line per method, and the MCP server returns the server alone instead of a tool list nothing read. The library audit drops options no caller sets. Search keeps one list of search types. One list printer and one bar chart serve every command. The Safari cookie parser drops checks that cannot fail and a field nothing reads. The API engine keeps one number reader, and the code uses `instanceof MusicError` and the built-in error cause directly. Two things look different on purpose. `playlist info` draws its bars like `replay` does. `playlist tracks` and `playlist list` are gone, because `library playlist` and `library playlists` do the same. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
7591f76 to
b0a9069
Compare
|
Note 🤖 Claude Opus 5.5 responding on behalf of proxynico Independent check: PASS on head The first check, on
The re-check found neither one is a defect:
After the rebase, |
Nico asked for Setlist's code to carry nothing it doesn't need. An audit found layers that only pass calls through, options nothing sets, checks that can't fail, and the same logic written twice. This removes them: about 160 fewer lines of source, with the CLI and MCP server returning the same results.
What changes
createMcpServerreturns the server. The tool list it also returned was never read.analyzeLibrarySnapshottakes the theme-suggestion count instead of an options object, andcollectLibrarySnapshottakesmaxItems. The other options (topLimit,generatedAt, the 20,000 default) were never set by any caller.listOutputfactory replacesoutputListand its five one-line wrappers, and one bar chart replaces the two.SEARCH_TYPESintypes.ts) instead of two.optionalNum) replaces three.now, and the playlist IDlabel), and three single-use types are inline.readU32already covers, anoffset < 0test on unsigned reads, a second loop, and the cookiepathfield nothing reads.instanceof MusicErrorreplacesisMusicError, andMusicErrorhandscauseto the built-inError.Two things change on purpose:
playlist infodraws its Top Artists and Genres bars the wayreplaydoes: scaled to the largest value, with labels measured to fit.playlist tracks <id>andplaylist list|lsare removed. They repeatedlibrary playlist <id>andlibrary playlists, and neither was documented.Blast Radius
setlist playlist tracksorsetlist playlist listnow gets "unknown command". The fix is to uselibrary playlistandlibrary playlists.playlist infohuman output looks different. Its--jsonand--plainoutput is the same.Verification
bun run check: Biome, typecheck and 87 tests pass. Two tests went with the code they tested (isMusicErroron plain values, and the recovery-hint text).--jsonand--plainoutput on main and on this branch, then compared them after masking Apple's time-signed artwork links and the audit timestamp. The commands covered all three engines: status, volume, devices, config, auth status, the five search kinds, library tracks, albums and playlists, playlist info, the four audit reports, replay, and the queue and error cases.playlist infobars and the two removed commands, which now printerror: unknown command.library_reportreports, replay, status, devices, and two errors). The results andtools/listmatched.volume 37, read back, thenvolume 100. On a temporary playlist made for the test:playlist add,library playlist,playlist rm, and add with an unknown track (Track not found). The playlist was deleted afterwards.Created with Claude Opus 5.5 in Claude Code.