Skip to content

mcp(stdio): restore the CurrentBranchInput narrowing on the eight local-branch tools - #10257

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
bitfathers94:fix/issue-10034
Jul 31, 2026
Merged

mcp(stdio): restore the CurrentBranchInput narrowing on the eight local-branch tools#10257
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
bitfathers94:fix/issue-10034

Conversation

@bitfathers94

Copy link
Copy Markdown
Contributor

mcp(stdio): restore the CurrentBranchInput narrowing on the eight local-branch tools

LocalBranchAnalysisInput widened login/repoFullName to required so the remote
server (no checkout) could advertise the full vocabulary, but the eight stdio
registrations of that contract never narrowed back down -- so the stdio server
advertised and enforced the same required fields the remote does, even though
its handlers resolve both from the active session and the checkout. Declares a
StdioLocalBranchAnalysisInput/StdioDraftPrBodyInput narrowing derived from the
contract (mirroring StdioMarkNotificationsReadInput) and wires it into the
eight registerStdioTool call sites via the existing input override seam.

Closes #10034

…al-branch tools

LocalBranchAnalysisInput widened login/repoFullName to required so the remote
server (no checkout) could advertise the full vocabulary, but the eight stdio
registrations of that contract never narrowed back down -- so the stdio server
advertised and enforced the same required fields the remote does, even though
its handlers resolve both from the active session and the checkout. Declares a
StdioLocalBranchAnalysisInput/StdioDraftPrBodyInput narrowing derived from the
contract (mirroring StdioMarkNotificationsReadInput) and wires it into the
eight registerStdioTool call sites via the existing input override seam.
@bitfathers94
bitfathers94 requested a review from JSONbored as a code owner July 31, 2026 14:39
@loopover-orb

loopover-orb Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Tip

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-31 14:49:02 UTC

4 files · 1 AI reviewer · no blockers · readiness 93/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This PR restores the intended narrowing (login/repoFullName optional) on the eight stdio local-branch tool registrations, which had drifted to advertising the wider LocalBranchAnalysisInput required-field shape after that contract was widened for the remote server. The fix is derived via `.partial()` off the existing contract per the file's own stated convention (mirroring StdioMarkNotificationsReadInput), wired through the existing `{ input: ... }` override seam at each `registerStdioTool` call site, and is backed by both a registry-level contract test (checkInputNarrowing invariants) and an in-process MCP client test asserting the advertised schema and that a login-less call reaches the handler. This is a narrowly-scoped, well-targeted fix that closes #10034.

Nits — 6 non-blocking
  • The flagged 'secret' at test/unit/mcp-cli-current-branch-input.test.ts:43 is `process.env.LOOPOVER_API_TOKEN = "in-process-token"`, a hardcoded test fixture token, not a real credential — worth a quick look but not an actual leak.
  • packages/loopover-mcp/bin/loopover-mcp.ts is a very large single file (per the file's own header comment this is a known, deliberate deferral of a split, not something this PR need address).
  • The two new `StdioLocalBranchAnalysisInput`/`StdioDraftPrBodyInput` JSDoc comments both reference mcp(stdio): restore the CurrentBranchInput narrowing on the eight local-branch tools #10034 inline in the exported symbol's doc comment rather than only in the PR/commit description, which will read oddly once the issue is old context.
  • Consider whether `loopover_agent_prepare_pr_packet`'s handler signature (`async (input: z.infer<typeof CurrentBranchInput>) => ...`) should be updated to reflect `StdioLocalBranchAnalysisInput` for type accuracy, since the runtime schema is now the wider partial type — verify this doesn't cause a type mismatch at that call site.
  • The contract-registry test's `narrows the eight stdio local-branch tools` case is a solid mechanical enforcement of checkInputNarrowing; consider whether scripts/lib/validate-mcp's own live check already covers this so as not to duplicate effort — if not, keep both since they check different points (unit vs. live catalog).
  • Possible secret-shaped assignment in the diff (generic_secret_assignment) — Verify the value is not a real credential.

Decision drivers

  • ✅ Code review — No blockers (1 reviewer)
  • ✅ Gate result — Passing (No configured blocker found.)
Context & advisory signals — never blocks the verdict
Signal Result Evidence
Linked issue ✅ Linked #10034
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (1 linked issue).
Validation posture ⚠️ 20/25 Preflight is ready, but the PR body does not name the validation run.
Contributor workload ✅ 10/10 Author activity: 140 registered-repo PR(s), 99 merged, 3 issue(s).
Contributor context ✅ Confirmed Gittensor contributor bitfathers94; Gittensor profile; 140 PR(s), 3 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: moderate
Linked issue satisfaction

Addressed
The PR declares StdioLocalBranchAnalysisInput/StdioDraftPrBodyInput as derived .partial() narrowings in the contract and wires them into all eight registerStdioTool call sites via the existing input override, exactly matching the requested pattern, while leaving LocalBranchAnalysisInput and the remote registrations untouched and preserving the draft_pr_body format field.

Review context
  • Author: bitfathers94
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: TypeScript
  • Official Gittensor activity: 140 PR(s), 3 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Start here: Add validation command/output.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
🧪 Chat with LoopOver

Ask 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.

  • @loopover ask &lt;question&gt; answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat &lt;question&gt; answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @loopover mention with a real question is routed to the closest matching read-only command automatically — no exact syntax required.

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.

  • Re-run LoopOver review

@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 31, 2026
@codecov

codecov Bot commented Jul 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.67%. Comparing base (2794910) to head (de102cf).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10257      +/-   ##
==========================================
- Coverage   80.60%   78.67%   -1.94%     
==========================================
  Files         283      285       +2     
  Lines       59101    61356    +2255     
  Branches     7000     7827     +827     
==========================================
+ Hits        47641    48271     +630     
- Misses      11167    12662    +1495     
- Partials      293      423     +130     
Flag Coverage Δ
backend 27.93% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...ckages/loopover-contract/src/tools/local-branch.ts 100.00% <100.00%> (ø)
packages/loopover-mcp/bin/loopover-mcp.ts 26.53% <ø> (ø)

@loopover-orb loopover-orb Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LoopOver approves — the gate is satisfied and CI is green.

@loopover-orb
loopover-orb Bot merged commit f945542 into JSONbored:main Jul 31, 2026
8 checks passed
@github-actions github-actions Bot mentioned this pull request Jul 31, 2026
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mcp(stdio): restore the CurrentBranchInput narrowing on the eight local-branch tools

1 participant