Skip to content

fix(mcp): loopover-mcp decision-pack and repo-decision ignore --help #5927

Description

@JSONbored

Context

packages/loopover-mcp/bin/loopover-mcp.js is the @loopover/mcp CLI. Every single-purpose,
--login-driven reporting subcommand follows the same convention: check for --help/help as the
first arg (or options.help === true) and print a dedicated usage block before doing any real work.
This is implemented for:

  • reviewPrCli (line ~1926): if (options.help === true) return printReviewPrHelp();
  • lintPrTextCli (line ~2006): if (!args.length || args[0] === "--help" || args[0] === "help") return printLintPrTextHelp();
  • validateConfigCli (line ~2049): same pattern, printValidateConfigHelp()
  • slopRiskCli, issueSlopCli: same pattern, printSlopRiskHelp() / printIssueSlopHelp()

Two commands in the same family never got this treatment: decisionPackCli (line 2163) and
repoDecisionCli (line 2176). Neither checks options.help/args[0] at all, and neither has a
print*Help function. Both commands are fully wired into runCli's dispatch table (line 1850-1851)
and into CLI_COMMAND_SPEC (used for shell completion), so they are discoverable, just not
--help-able.

Concretely, today:

$ loopover-mcp decision-pack --help
Error: Pass --login <github-login> or set LOOPOVER_LOGIN.

--help is silently swallowed by parseOptions (becomes options.help = true, which
decisionPackCli never reads), so the command falls straight into its normal --login requirement
check and throws a login error instead of showing usage — the opposite of what a user typing
--help wants, and inconsistent with every sibling command in CLI_COMMAND_SPEC's flat (non-nested)
command list.

Requirements

  • Add printDecisionPackHelp() and printRepoDecisionHelp() functions (or one shared helper,
    following the existing print*Help naming/format convention already used by printReviewPrHelp
    etc. — usage line(s), one-paragraph description, "Pass --json for machine-readable output.").
  • decisionPackCli and repoDecisionCli must short-circuit on --help/help as the first arg (or
    options.help === true, matching whichever of the two established patterns fits the existing
    runCli call site for each command) and print their new help text before requiring --login /
    --repo.
  • Do not change any non-help behavior of either command.

Deliverables

  • printDecisionPackHelp() in packages/loopover-mcp/bin/loopover-mcp.js, wired into
    decisionPackCli.
  • printRepoDecisionHelp() (or equivalent) wired into repoDecisionCli.
  • Regression tests in test/unit/mcp-cli-basics.test.ts (or a new
    test/unit/mcp-cli-decision-pack.test.ts) asserting loopover-mcp decision-pack --help and
    loopover-mcp repo-decision --help print usage and exit 0, without requiring --login/--repo
    or making any network call.

Test Coverage Requirements

packages/loopover-mcp/bin/loopover-mcp.js is outside this repo's Codecov coverage.include
(vitest.config.ts's coverage.include is limited to src/**/*.ts,
packages/loopover-engine/src/**/*.ts, packages/loopover-miner/lib/**/*.js, and one
review-enrichment file — packages/loopover-mcp/** is not listed, and codecov.yml doesn't
override that), so Codecov's 99% patch gate does not numerically measure this change. Behavioral
regression coverage is still required and enforced by npm run test:mcp-pack/test:ci running the
full test/unit/mcp-cli-*.test.ts subprocess suite — add the new --help assertions there so a
future regression is still caught, even though Codecov won't flag it.

Expected Outcome

loopover-mcp decision-pack --help and loopover-mcp repo-decision --help print usage text and
exit 0, matching the behavior of every other single-purpose subcommand in this CLI family
(review-pr, lint-pr-text, validate-config, slop-risk, issue-slop).

Links & Resources

  • packages/loopover-mcp/bin/loopover-mcp.jsdecisionPackCli (~L2163), repoDecisionCli
    (~L2176), runCli dispatch (~L1850-1851), sibling pattern at reviewPrCli (~L1925-1926) and
    lintPrTextCli/printLintPrTextHelp (~L1993-2006).
  • test/unit/support/mcp-cli-harness.ts for the existing run()/runAsync() test harness pattern.

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:bugGittensor-scored bug fix — scores a 0.05x multiplier.gittensor:priorityMaintainer-selected Gittensor priority — scores a 1.5x multiplier.help wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions