chore(mcp): remove dead referenceScorePreviewCommand export in local-branch.js - #6402
Conversation
…branch.js Its only real caller was test/unit/local-scorer-adapter.test.ts, which uses it to exercise the actual bundled scorer script end to end. Production guidance text always uses the sibling referenceScorePreviewExample instead -- and that's intentional, not a bug: an existing test explicitly asserts the guidance text stays generic/path-redacted (never leaks the real local filesystem path), so wiring in the absolute-path version would have been a regression, not a fix. Moved the packaged-scorer path resolution into the test file itself (the same join(process.cwd(), ...) pattern already used by its neighboring fixtureCommand() helper) since the test is genuinely its only caller. packageRoot and its now-unused dirname import are removed from local-branch.js along with the export. Closes JSONbored#6259
|
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 #6402 +/- ##
=======================================
Coverage 95.61% 95.61%
=======================================
Files 600 601 +1
Lines 47350 47352 +2
Branches 15063 15063
=======================================
+ Hits 45272 45274 +2
Misses 1291 1291
Partials 787 787
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-16 07:03:09 UTC
Review summary Nits — 3 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
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.
|
Closes #6259
Summary
referenceScorePreviewCommand(computes the real, absolute path to the bundled scorer viapackageRoot) vs.referenceScorePreviewExample(a hardcoded./node_modules/@loopover/mcp/scripts/...string used in guidance text).referenceScorePreviewCommandinto guidance text would have been a regression, not a fix.test/unit/local-scorer-adapter.test.ts's existing "redacts local paths from scorer diagnostics and setup guidance" test explicitly asserts the guidance text (a) never contains the real local filesystem path and (b) matches/node_modules\/@loopover\/mcp\/scripts\//— i.e. the generic relative example is intentional, deliberately avoiding leaking an absolute local path (which could embed a username or other identifying info) into text a user might copy elsewhere.referenceScorePreviewExampleis correct as-is; left untouched.referenceScorePreviewCommand's real (and legitimate) use was as a test helper:local-scorer-adapter.test.ts's "runs the packaged reference scorer against metadata only" test uses it to invoke the actual bundled scorer script end to end — a genuinely valuable smoke test, not dead functionality. Removing it outright would have thrown that test coverage away.join(process.cwd(), ...)pattern the test's neighboringfixtureCommand()helper already uses), since the test is genuinely its only real caller. Removed the now-orphanedreferenceScorePreviewCommandexport,packageRoot, and the resulting unuseddirnameimport fromlib/local-branch.js.Scope
type(scope): short summaryConventional Commit format.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
git diff --checknpm run actionlintnpm run typecheck(root) — reliably OOMs on this shared sandbox regardless of what changed (reproduced repeatedly this session).packages/loopover-mcpis plain JS with its ownnpm run build(node --checkacross every lib/bin file) — ran it directly and it passes clean.npm run test:coverage— not run repo-wide (same OOM risk); this change touches apackages/loopover-mcp/**JS file (notsrc/**) and a test file, socodecov/patchscope is minimal. Ran the full set of tests that import fromlocal-branch.js:local-scorer-adapter.test.ts(7),local-branch.test.ts(59),mcp-release-candidate.test.ts(20) — 86/86 passing, including the "runs the packaged reference scorer against metadata only" smoke test still genuinely invoking the real bundled script, and the redaction test confirming guidance text is unaffected.npm run test:workers— N/A, no Worker-facing code changed.npm run build:mcp/npm run test:mcp-pack— N/A wiring, butpackages/loopover-mcp's ownnpm run build(syntax-checks every lib/bin file including the editedlocal-branch.js) passes clean.npm run ui:openapi:check/ui:lint/ui:typecheck/ui:build— N/A, noapps/loopover-uichanges.npm audit --audit-level=moderate— 0 vulnerabilities.If any required check was skipped, explain why:
npm run typecheck/npm run test:coverage: reliably OOMs on this shared sandbox under memory pressure from concurrent sessions, independent of the diff. Substituted withpackages/loopover-mcp's own lighter build check (clean) and the full set of directly-affected tests (86/86 passing).Safety
UI Evidencesection below with screenshots. — N/A, no visible UI change.CHANGELOG.mduntouched.Notes
grep -rn "referenceScorePreviewCommand\b"across the repo (excludingnode_modules) that zero references remain after the change.