Skip to content

chore(mcp): convert lib/local-branch to TypeScript - #7418

Closed
lourincedaging0-commits wants to merge 1 commit into
JSONbored:mainfrom
lourincedaging0-commits:chore/mcp-local-branch-ts2
Closed

chore(mcp): convert lib/local-branch to TypeScript#7418
lourincedaging0-commits wants to merge 1 commit into
JSONbored:mainfrom
lourincedaging0-commits:chore/mcp-local-branch-ts2

Conversation

@lourincedaging0-commits

Copy link
Copy Markdown
Contributor

Phase 2 of the packages/loopover-mcp TypeScript migration (#7291), on the tsc pipeline from Phase 1 (#7409).

What

Port lib/local-branch.jslib/local-branch.ts. The tsconfig include glob (lib/**/*.ts) picks it up; it compiles in place to lib/local-branch.js (inline source map, no .d.ts) — the same layout the package already ships, so no import path changes.

Behavior

Runtime behavior and the public export surface are unchanged — every exported function keeps its name and semantics, bin/loopover-mcp.js and test/unit/local-scorer-adapter.test.ts consume the compiled .js exactly as before. Types are added at the git-diff / scorer-JSON boundaries as open records, matching the already-converted lib/ files, so the strict build stays clean without narrowing the dynamic shapes.

Closes #7329

Phase 2 of the packages/loopover-mcp TypeScript migration (JSONbored#7291), building
on the tsc build pipeline from Phase 1 (JSONbored#7409). Port lib/local-branch.js to
lib/local-branch.ts; it compiles in place to lib/local-branch.js (inline
source map, no .d.ts), the same file set the package already ships.

Runtime behavior and the public export surface are unchanged: every exported
function keeps its name and semantics, and bin/loopover-mcp.js consumes the
compiled .js exactly as before. Types are added at the git-diff/JSON/scorer
boundaries as open records, matching the already-converted lib/ files.

Closes JSONbored#7329
@superagent-security

Copy link
Copy Markdown
Contributor

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

@codecov

codecov Bot commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.83%. Comparing base (603ea35) to head (4f21b80).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #7418       +/-   ##
===========================================
- Coverage   91.27%   80.83%   -10.45%     
===========================================
  Files         716       84      -632     
  Lines       72972    22642    -50330     
  Branches    21527     3648    -17879     
===========================================
- Hits        66605    18302    -48303     
+ Misses       5327     4162     -1165     
+ Partials     1040      178      -862     
Flag Coverage Δ
shard-1 0.00% <ø> (-32.65%) ⬇️
shard-2 0.00% <ø> (-36.08%) ⬇️
shard-3 0.00% <ø> (-34.55%) ⬇️
shard-4 0.00% <ø> (-42.91%) ⬇️
shard-5 0.00% <ø> (-36.99%) ⬇️
shard-6 0.00% <ø> (-33.57%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 632 files with indirect coverage changes

@loopover-orb loopover-orb Bot added the gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. label Jul 20, 2026
@loopover-orb

loopover-orb Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Caution

🛑 LoopOver review result - reject/close recommended

Review updated: 2026-07-20 08:48:47 UTC

2 files · 1 AI reviewer · 1 blocker · CI failing · blocked

🛑 Suggested Action - Reject/Close

Review summary
The AI review returned blocking findings for this change but did not include a separate narrative summary. Review the blockers below before deciding this PR.

Blockers

  • CI is failing on validate, validate-tests-merge, and validate-code for this commit — these need to be green before merge, and nothing in the diff or description explains the failures.
  • The linked issue chore(mcp): convert lib/local-branch.js to TypeScript (Phase 2 of #7291) #7329 title only covers 'convert lib/local-branch.js to TypeScript' but the external brief flags partial coverage — confirm the issue actually authorizes this exact scope (types-as-open-records approach) before merging.
Nits — 6 non-blocking
  • packages/loopover-mcp/lib/local-branch.ts:594 — `splitCommand`'s regex `(?:[^\s"]+|"[^"]*")+` nests an unbounded quantifier inside an unbounded group; this only runs on locally-configured GITTENSOR_SCORE_PREVIEW_CMD strings (not attacker-controlled network input), so it's a hardening nit, not a blocker — consider a linear-time tokenizer if you want to close it off.
  • packages/loopover-mcp/lib/local-branch.ts:528 — the `execError: any` annotation on classifyScorerExecFailure's error param loses type-checking on execFileSync's error shape; consider narrowing to `NodeJS.ErrnoException & { stdout?: string; stderr?: string; status?: number }`.
  • No test files were added for this 646-line new source file; per repo convention (~97% patch coverage), even a mechanical port typically needs at least a smoke test importing the compiled output to catch transpile drift.
  • packages/loopover-mcp/lib/local-branch.ts:92 collectLocalBranchMetadata and :493 normalizeScorerOutput exceed the repo's complexity threshold (15 and 12 vs 10) — both pre-existed in the JS original, so not a regression, but worth a follow-up split if touched again.
  • packages/loopover-mcp/lib/local-branch.js:419-420 use 'origin/master' as a non-inclusive fallback branch name — this matches the pre-existing JS behavior so it's not introduced by this PR, just flagging for a future pass.
  • Code changes lack test evidence — Add focused regression tests or explain why existing coverage is sufficient.

Why this is blocked

  • CI is failing on validate, validate-tests-merge, and validate-code for this commit — these need to be green before merge, and nothing in the diff or description explains the failures.
📋 Copy for AI agents — paste into your coding agent
Fix the following blocker(s) from this PR review:

1. CI is failing on validate, validate-tests-merge, and validate-code for this commit — these need to be green before merge, and nothing in the diff or description explains the failures.

CI checks failing

  • validate
  • validate-tests-merge
  • validate-code

Decision drivers

  • ❌ Code review — 1 blocker (1 reviewer)
  • ❌ Gate result — Blocking (Repo-configured hard blocker found.)
Context & advisory signals — never blocks the verdict
Signal Result Evidence
Linked issue ✅ Linked #7329
Related work ⚠️ 3 scoped overlaps Top overlaps are listed below; lower-confidence bulk is hidden.
Change scope ❌ 8/20 High review scope from cached public metadata (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 94 registered-repo PR(s), 46 merged, 5 issue(s).
Contributor context ✅ Confirmed Gittensor contributor lourincedaging0-commits; Gittensor profile; 94 PR(s), 5 issue(s).
Improvement ℹ️ None detected risk: low · value: none · LLM: moderate
Linked issue satisfaction

Addressed
The PR adds lib/local-branch.ts with typed exports and updates the compiled lib/local-branch.js in place matching the existing package layout, mirroring exactly the deliverable requested (convert .js to .ts, build pipeline from Phase 1, no behavior change).

Review context
  • Author: lourincedaging0-commits
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: HTML
  • Official Gittensor activity: 94 PR(s), 5 issue(s).
  • Related work: Titles/paths share 5 meaningful terms. (issue #7328)
  • Related work: Titles/paths share 11 meaningful terms. (issue #7329, issue #7328)
  • Related work: Titles/paths share 10 meaningful terms. (issue #7329, issue #7330)
  • Additional title-only matches omitted; title-only overlap does not block.
Contributor next steps
  • Start here: Review top overlaps.
  • Then work through the remaining 2 steps in the Signals table above.
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

@loopover-orb

loopover-orb Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

LoopOver is closing this pull request on the maintainer's behalf (CI is failing (validate, validate-tests-merge, validate-code); AI reviewers agree on a likely critical defect: CI is failing on validate, validate-tests-merge, and validate-code for this commit — these need to be green before merge, and nothing in the diff or description explains the failures.). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed.

@loopover-orb loopover-orb Bot closed this Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore(mcp): convert lib/local-branch.js to TypeScript (Phase 2 of #7291)

1 participant