feat(api): REST + CLI mirror for loopover_build_results_payload - #6904
Conversation
The loopover_build_results_payload MCP tool (src/mcp/server.ts, via the pure buildResultsPayload composer) had neither a REST route nor a CLI mirror, unlike its same-tier sibling loopover_check_slop_risk, which has both. Both are pure, source-free composers over caller-supplied, already-computed data. Add POST /v1/loop/results-payload, delegating to the same buildResultsPayload the tool calls and adding no logic of its own, and register the matching in-process loopover_build_results_payload stdio tool so results composition also works fully offline. Both surfaces mirror buildResultsPayloadShape verbatim, so no surface can accept an input another would reject. Closes JSONbored#6752
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6904 +/- ##
=======================================
Coverage 93.70% 93.70%
=======================================
Files 685 685
Lines 68284 68290 +6
Branches 18715 18716 +1
=======================================
+ Hits 63985 63991 +6
Misses 3302 3302
Partials 997 997
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-17 12:03:24 UTC
Review summary Nits — 5 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://loopover.ai/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.
|
The
loopover_build_results_payloadMCP tool (src/mcp/server.ts, via the purebuildResultsPayloadcomposer) has neither a REST route nor a CLI mirror — unlike its same-tier siblingloopover_check_slop_risk(/v1/lint/slop-risk+ stdio tool), which has both. Both are pure, source-free composers over caller-supplied, already-computed data, so the parity gap is the only difference between them.Changes
POST /v1/loop/results-payload— delegates to the samebuildResultsPayloadthe tool calls and adds no logic of its own. It formats the result; it does not fetch, open, or deliver anything. Placed alongside its source-free/v1/loop/evaluate-escalationand/v1/lint/*siblings.loopover_build_results_payloadstdio tool — computed in-process from@loopover/engine, so results composition works fully offline with no API round-trip (same posture as thecheck_slop_risklocal mirror).buildResultsPayloadShape(src/mcp/server.ts) verbatim — same bounds, same optionality — so no surface can accept an input another would reject.Tests
test/unit/routes-results-payload.test.ts— pins the ROUTE contract: the composed payload is returned unmodified for every shape the tool accepts (PR/no-PR, absent vs nullprNumber, each status, absent/empty/partialchangedFiles, and a change over the diff-preview cap where totals must still count every file), invalid/unparseable bodies are rejected with 400, and no wallet/hotkey/trust-score terms leak.test/unit/mcp-cli-results-payload-tool.test.ts— cross-surface PARITY: the stdio tool returns exactly what the pure composer returns for identical input, proven offline against a black-holed API URL, plus input-schema rejection.Rebased onto current
main(e118f6e9), which includes the terraform/sentry/branding-drift cleanup — the branding-drift regression guard passes on this branch (35 file(s) match the recorded baseline).Closes #6752