chore(mcp): convert lib/local-branch.js to TypeScript (Phase 2 of #7291) - #7417
chore(mcp): convert lib/local-branch.js to TypeScript (Phase 2 of #7291)#7417oktofeesh1 wants to merge 1 commit into
Conversation
Converts lib/local-branch.js to real TypeScript (in-place .ts -> .js emit, import paths unchanged), building on Phase 1's build pipeline. Adds targeted test coverage for git-plumbing edge cases (defaultBaseRef's origin/HEAD/main/master precedence, a real type-change git status, workspace-root path resolution) and scorer failure classification (malformed JSON via message inspection, spawn failures, signal kills), and simplifies a few defensive fallbacks that were provably unreachable given their sole caller's own guarantees. Refs JSONbored#7329
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7417 +/- ##
==========================================
+ Coverage 91.22% 91.28% +0.06%
==========================================
Files 716 716
Lines 72801 72826 +25
Branches 20885 20990 +105
==========================================
+ Hits 66414 66481 +67
+ Misses 5347 5294 -53
- Partials 1040 1051 +11
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
Caution 🛑 LoopOver review result - fixes requiredReview updated: 2026-07-20 08:34:59 UTC
Review summary Nits — 1 non-blocking
CI checks failing
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.
|
|
LoopOver is closing this pull request on the maintainer's behalf (CI is failing (codecov/patch)). 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. |
Summary
lib/local-branch.js(592 lines) to real TypeScript (in-place.ts->.jsemit, import paths unchanged), building on Phase 1's (chore(mcp): add tsc build pipeline + convert small lib utilities to TypeScript (Phase 1 of #7291) #7328) build pipeline..d.tsartifact, no allowlist changes needed.Scope
type(scope): short summaryConventional Commit format.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Closes #7329
Validation
git diff --checknpm run actionlintnpm run typechecknpm run test:coveragelocally --local-branch.tsreaches ~99% lines / ~96%+ branches across 99 tests (73 intest/unit/local-branch.test.ts, 26 intest/unit/local-scorer-adapter.test.ts), including new coverage fordefaultBaseRef's origin/HEAD -> origin/main -> origin/master precedence (viagit update-ref-faked remote-tracking refs, no real network needed), a real git type-change status (regular file <-> symlink), MCP workspace-root path resolution, andclassifyScorerExecFailure's failure-classification branches (a circular-JSON-metadata case exercising the message-based JSON check, a SIGKILL-terminated child, and a spawn/command-not-found case). A handful of defensive fallbacks provably unreachable given their sole caller's own guarantees were simplified (matching the pattern already used in this migration'spackages/loopover-minerbatches), and one genuinely-unreachable git status code (C/copied --collectChangedFilesonly ever passes-M, never-C) is marked with av8 ignorecomment rather than deleted, since it's a real status git can produce with different flags.npm run test:workersnpm run build:mcpnpm run test:mcp-packnpm run ui:openapi:checknpm run ui:lintnpm run ui:typechecknpm run ui:buildnpm audit --audit-level=moderateIf any required check was skipped, explain why:
npm audit --audit-level=moderatereports a pre-existing high-severityadm-zipadvisory (no fix available) viagithub-actionlint, inherited unchanged frommainand unrelated to this PR'spackages/loopover-mcpscope.Safety
Notes
.js.local-branch.test.ts,local-scorer-adapter.test.ts) had a@ts-expect-errorsuppression for dynamically importing what was previously an untyped.jsmodule; these are now stale (TypeScript resolves the import to the new.tssource directly) and were removed.