fix(mcp): complete tab-completion for cache list - #6298
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
CLI_COMMAND_SPEC's cache entry read ["status", "clear"], but runCacheCli has always accepted list/ls too, and both printCacheHelp and the README document `loopover-mcp cache list`. That entry is the single source for buildBash/Zsh/Fish/PowershellCompletion and for suggestCommand's typo-suggester, so tab-completion for `cache list` silently did nothing across all four shells -- while status/clear completed fine, which is why it went unnoticed. Add "list". Only the canonical name: the spec deliberately lists canonical subcommands only, since profile accepts ls/use/rm/delete and maintain accepts pending, yet none of those aliases appear in their entries. Audited every other entry against its handler, as the issue asks, and cache was the only stale one: agent (plan/status/explain/packet), profile (list/create/switch/remove) and maintain (status/queue/approve/ reject/pause/resume/set-level/precision) each already declare every canonical subcommand their handler runs. The test pins that audit as an invariant rather than just this one miss, in both directions: every canonical subcommand a handler accepts must be declared, and nothing declared may be unhandled (which would complete to a guaranteed error). So the next entry to rot fails CI instead of silently degrading completion. It reads the spec out of the committed source because bin/loopover-mcp.js starts a server on import, and it checks all four shells, since one stale entry breaks every one of them. Closes JSONbored#6260
matchAll's capture groups are string | undefined under this repo's strict TS config, so indexing spec[rawName] and calling rawSubs.matchAll tripped TS2538/TS18048. vitest transpiles without typechecking, which is why the suite passed locally while validate-code failed. Bind both groups explicitly instead.
e3eed00 to
2f1792d
Compare
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-16 01:05:35 UTC
Review summary Nits — 3 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://gittensory.aethereal.dev/docs/loopover-commands 🧪 Experimental — new and may change. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
Summary
Closes #6260
CLI_COMMAND_SPEC'scacheentry read["status", "clear"], butrunCacheCli(bin/loopover-mcp.js:2340) has always acceptedlist/ls, and bothprintCacheHelpand the README documentloopover-mcp cache list.That entry is the single source for
buildBashCompletion/buildZshCompletion/buildFishCompletion/buildPowershellCompletionand forsuggestCommand's typo-suggester — so tab-completion forcache listsilently did nothing across all four shells, whilestatus/clearcompleted fine. That asymmetry is exactly why it went unnoticed.Fix: add
"list"— one word.Only the canonical name, and that's an evidence-based call rather than a guess: the spec deliberably lists canonical subcommands only.
profileCommandacceptsls/use/rm/deleteandmaintainCliacceptspending, yet none of those aliases appear in their spec entries. Completing an alias isn't the contract; completing every real subcommand is.The audit the issue asks for
Done —
cachewas the only stale entry:status,clear,list(ls)status,clearplan,status,explain,packetlist(ls),create,switch(use),remove(rm/delete)status,queue(pending),approve,reject,pause,resume,set-level,precisionScope
fix(mcp): …).CONTRIBUTING.md; nosite//CNAME/lovable; no changelog edit.Validation
git diff --checkclean.npm run build --workspace @loopover/mcp(the package'snode --checkgate) — exit 0.mcp-cli-completion-spec,mcp-cli-basics,mcp-tool-rename-aliases(the 42-tool count canary),command-suggest,mcp-cli-packets: 71 tests passed.REGRESSION: cache declares list…, the cache parity case, and the typo-suggester case), then pass again with it restored.scripts/gen-command-reference.mjsdoes not readCLI_COMMAND_SPEC, socommand-reference:checkis unaffected and no generated artifact needs regenerating.npm run ui:lint(@loopover/ui+@loopover/ui-miner), which coversapps/**— this PR touches neither.bin/loopover-mcp.jsis not prettier-formatted onmaineither, so no formatting rule applies to it.main.The test pins the audit as an invariant, in both directions, rather than just this one miss:
REGRESSION: cache declares listcache listIt reads the spec out of the committed source rather than importing it, because
bin/loopover-mcp.jsstarts a server on import — parsing is how a test can inspect the spec without launching one.If any required check was skipped, explain why:
test:cinot run end-to-end locally (Linux-only steps on Windows). The change-relevant gates — the package's syntax check and every suite touching this file or the CLI spec — were run directly and are green.packages/loopover-mcp/**is outside Codecov'scoverage.include;test/**is ignored.Safety
cache status/cache clearare untouched, and the added value routes to an already-implemented, already-documented path.