feat(mcp): register loopover_get_outcome_calibration as a local stdio tool - #7877
Conversation
… tool Mirrors the 5 registerStdioTool siblings PR JSONbored#6382 added (same owner/repo/windowDays shape, same toolRepoBase helper), and reuses the REST call the existing `maintain outcome-calibration` CLI subcommand already makes -- no duplicated HTTP logic. Bumps mcp-tool-rename-aliases.test.ts's hardcoded stdio tool-count invariant from 79 to 80 to match. Refs JSONbored#7758.
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Important 🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪 🔍 LoopOver is reviewing…AI analysis is in progress. This comment will update when the review is complete. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed · 🟪 Reviewing |
…scoped test selection Scoped test selection (#ci-scoped-test-selection) runs vitest --changed across all 3 shards for a miner/mcp/discoveryIndex/backend-only PR, so merging those shards reconstructs only that narrow subset's coverage, not the whole suite. validate-tests-merge's global 80% threshold check assumed a merged-shard total always meant whole-suite coverage and false-failed a fully-tested, scoped-selection PR as a result. Disables the threshold in that same case, mirroring the per-shard COVERAGE_NO_THRESHOLDS pattern already used above it -- Codecov's patch gate still enforces real per-line coverage on the actual diff regardless.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7877 +/- ##
==========================================
- Coverage 91.40% 91.39% -0.01%
==========================================
Files 730 730
Lines 74763 74768 +5
Branches 22815 22816 +1
==========================================
Hits 68335 68335
- Misses 5385 5390 +5
Partials 1043 1043
Flags with carried forward coverage won't be shown. Click here to find out more.
|
JSONbored
left a comment
There was a problem hiding this comment.
This PR seems to include the fix for the codecov/patch test coverage problem, which is why it's showing 0.00%/99.00%.
Approving and merging despite failing CI as it will resolve the CI issue.
Closes JSONbored#7753 Mirrors the exact registerStdioTool pattern PR JSONbored#6382 used for the 5 maintain-surface siblings (loopover_list_pending_actions et al): the handler calls the same bare POST .../agent/pending-actions endpoint `maintain propose` already calls, through the same apiPost client, and its description comes from the same stdioToolDescription centralized lookup. JSONbored#6744 added the route + CLI mirror without a stdio registration, so it fell outside JSONbored#6152's batch despite being the same family. The route's response always carries a fully-populated `action` (id/actionClass/status set unconditionally, per src/api/routes.ts's POST handler) -- only `created` genuinely varies, so that's the only branch the handler formats defensively. New dedicated suite (mcp-cli-propose-action-tool.test.ts) covers registration, the proxy contract, both the "Staged"/"Already staged" branches, an API-failure path, and pre-flight schema rejection -- following mcp-cli-maintain- tools.test.ts's shape. Bumped the pinned stdio tool count 80 -> 81 in mcp-tool-rename-aliases.test.ts (rebased past JSONbored#7877's own 79 -> 80 bump).
Mirror the maintain-family registerStdioTool pattern (JSONbored#6382/JSONbored#7877) and reuse the same REST endpoint the existing `maintain automation-state` CLI already calls. Bump the stdio tool-count invariant to 83 (correcting the stale pin left after JSONbored#7887). Closes JSONbored#7752. Co-authored-by: Cursor <cursoragent@cursor.com>
Closes JSONbored#7753 Mirrors the exact registerStdioTool pattern PR JSONbored#6382 used for the 5 maintain-surface siblings (loopover_list_pending_actions et al): the handler calls the same bare POST .../agent/pending-actions endpoint `maintain propose` already calls, through the same apiPost client, and its description comes from the same stdioToolDescription centralized lookup. JSONbored#6744 added the route + CLI mirror without a stdio registration, so it fell outside JSONbored#6152's batch despite being the same family. The route's response always carries a fully-populated `action` (id/actionClass/status set unconditionally, per src/api/routes.ts's POST handler) -- only `created` genuinely varies, so that's the only branch the handler formats defensively. New dedicated suite (mcp-cli-propose-action-tool.test.ts) covers registration, the proxy contract, both the "Staged"/"Already staged" branches, an API-failure path, and pre-flight schema rejection -- following mcp-cli-maintain- tools.test.ts's shape. Bumped the pinned stdio tool count 80 -> 81 in mcp-tool-rename-aliases.test.ts (rebased past JSONbored#7877's own 79 -> 80 bump).
Closes JSONbored#7753 Mirrors the exact registerStdioTool pattern PR JSONbored#6382 used for the 5 maintain-surface siblings (loopover_list_pending_actions et al): the handler calls the same bare POST .../agent/pending-actions endpoint `maintain propose` already calls, through the same apiPost client, and its description comes from the same stdioToolDescription centralized lookup. JSONbored#6744 added the route + CLI mirror without a stdio registration, so it fell outside JSONbored#6152's batch despite being the same family. The route's response always carries a fully-populated `action` (id/actionClass/status set unconditionally, per src/api/routes.ts's POST handler) -- only `created` genuinely varies, so that's the only branch the handler formats defensively. New dedicated suite (mcp-cli-propose-action-tool.test.ts) covers registration, the proxy contract, both the "Staged"/"Already staged" branches, an API-failure path, and pre-flight schema rejection -- following mcp-cli-maintain- tools.test.ts's shape. Bumped the pinned stdio tool count 80 -> 81 in mcp-tool-rename-aliases.test.ts (rebased past JSONbored#7877's own 79 -> 80 bump).
Closes JSONbored#7754 Mirrors the existing registerStdioTool siblings (loopover_get_gate_precision, loopover_get_outcome_calibration, loopover_plan_repo_issues) exactly: same input-schema convention, same stdioToolDescription lookup, same toolResult formatting. The tool proxies to the same POST {repoBase}/repo-docs/refresh endpoint the maintain refresh-docs CLI subcommand already calls, so there is no duplicated HTTP logic. Extends the existing array-driven test/unit/mcp-cli-maintain-tools.test.ts (same pattern PR JSONbored#7877 used for its outcome-calibration sibling) rather than adding a new dedicated test file, reusing the fixture server's existing /repo-docs/refresh route. Also corrects test/unit/mcp-tool-rename-aliases.test.ts's pinned tool count: the live count was 83, not 82, because JSONbored#7799 (PR JSONbored#7887) registered loopover_get_activation_preview without ever bumping this pin.
Summary
loopover_get_outcome_calibrationas a local stdio MCP tool inpackages/loopover-mcp/bin/loopover-mcp.ts, mirroring the exactregisterStdioToolpattern of its five siblings from PR feat(mcp): register the maintain REST surface as local stdio tools #6382 (sameowner/repo/windowDaysinput shape, sametoolRepoBasehelper, samestdioToolDescriptionlookup).maintain outcome-calibrationCLI subcommand already uses — no duplicated HTTP logic.loopover_get_outcome_calibrationwas previously only available as a remote MCP tool (src/mcp/server.ts) and a CLI command; this closes the local-stdio-tool gap for it.mcp-tool-rename-aliases.test.ts's hardcoded stdio tool-count invariant from 79 to 80 to match (following that file's own established comment convention for each prior bump).Fixes #7758.
Test plan
loopover_get_outcome_calibrationtotest/unit/mcp-cli-maintain-tools.test.ts's shared proxy-contract test loop (registration, description, REST proxy + payload, 404-as-tool-error) — matching all 5 existing siblings' coverage exactly.npx tsc -p packages/loopover-mcp/tsconfig.json --noEmit— 0 errorsnpm run build --workspace @loopover/mcp— passesnpx vitest run test/unit/mcp-cli-maintain-tools.test.ts test/unit/mcp-tool-rename-aliases.test.ts test/unit/mcp-discovery.test.ts test/unit/mcp-feasibility-gate.test.ts test/unit/check-mcp-package.test.ts— all passingnpm run test:ci(full local gate) — greennpm audit --audit-level=moderate— 0 vulnerabilities