Skip to content

fix(mcp): re-sync isTestFile with the server isTestPath (pytest prefix + JVM/C#/Swift) - #2753

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
glorydavid03023:fix/mcp-isTestFile-jvm-pytest-parity
Jul 3, 2026
Merged

fix(mcp): re-sync isTestFile with the server isTestPath (pytest prefix + JVM/C#/Swift)#2753
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
glorydavid03023:fix/mcp-isTestFile-jvm-pytest-parity

Conversation

@glorydavid03023

Copy link
Copy Markdown
Contributor

What

The MCP local-branch isTestFile (packages/gittensory-mcp/lib/local-branch.js) is a standalone inlined copy of the server's canonical isTestPath (src/signals/test-evidence.ts) — the MCP ships as a Node bin package and can't import from src/. Two test-convention rules added to isTestPath were never mirrored into this copy:

  • the pytest test_*.py prefix (#2666)
  • the JVM / C# / Swift SomethingTest(s)/Spec class-suffix (#2743): \w*(Tests?|Spec)\.(java|kt|kts|scala|cs|swift|groovy)

Why it matters

isTestFile drives how the MCP's local pre-submit predictor classifies changed files (test vs source) when it builds the local score packet. Because these two rules were missing, the predictor counted Java/Kotlin/Scala/C#/Swift test classes and pytest-prefixed files as SOURCE — disagreeing with the server gate's own test-coverage classification. A contributor in those ecosystems using the MCP gets a wrong local prediction about their test coverage / readiness.

Concrete: app/FooTests.java, src/BarSpec.kt, tests/test_utils.py were all classified as non-test (and, for the .java/.kt/.scala ones, wrongly counted as code) by the MCP, while the server treats them as tests.

Fix

Add both rules verbatim from isTestPath — same order, same case-sensitive JVM suffix so a source file merely ending in "test"/"spec" (Latest.java, Contest.cs, manifest.scala) stays source. This restores the copy's parity with the canonical matcher (the same single-sourcing discipline as #2665).

Tests

Extends the existing MCP-copy classifier test (test/unit/local-branch.test.ts) with the pytest-prefix and JVM/C#/Swift test cases (now classified as tests) plus the case-sensitive negatives (still source). Fails on the pre-fix copy, passes with the fix.

…x + JVM/C#/Swift)

The MCP local-branch isTestFile is a standalone inlined copy of the server's
canonical isTestPath (packages/gittensory-mcp ships as a Node bin package, so it
cannot import from src/). Two conventions added to isTestPath were never mirrored
here: the pytest `test_*.py` prefix (JSONbored#2666) and the JVM/C#/Swift
`SomethingTest(s)`/`Spec` class-suffix (JSONbored#2743). So the local pre-submit predictor
counted Java/Kotlin/Scala/C#/Swift test classes and pytest-prefixed files as
SOURCE, disagreeing with the server gate's own test-coverage classification and
misleading contributors in those ecosystems about readiness.

Add both rules verbatim from isTestPath (same order, same case-sensitive JVM
suffix so `Latest.java`/`Contest.cs`/`manifest.scala` stay source). Adds
regressions to the MCP-copy classifier test.
@codecov

codecov Bot commented Jul 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.09%. Comparing base (b945ede) to head (c710ae3).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2753   +/-   ##
=======================================
  Coverage   96.09%   96.09%           
=======================================
  Files         245      245           
  Lines       27391    27391           
  Branches     9947     9947           
=======================================
  Hits        26322    26322           
  Misses        443      443           
  Partials      626      626           
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

loopover-orb Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Warning

🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-07-03 18:39:27 UTC

2 files · 1 AI reviewer · no blockers · readiness 73/100 · CI green · clean

⏸️ Suggested Action - Manual Review

Review summary
This change brings the MCP-local test classifier back into parity with the server matcher for pytest prefix files and JVM/C#/Swift/Groovy test-class suffixes. The added rules match the canonical behavior shown in the provided server tests, and the local predictor now excludes those files from source classification through the existing isCodeFile -> isTestFile relationship. The visible tests cover positive cases and the important case-sensitive negatives, so the diff is safe enough to proceed.

Nits — 4 non-blocking
  • nit: test/unit/local-branch.test.ts:1766 packs many classifier cases into one long inline array, which makes future parity additions harder to diff and scan.
  • packages/gittensory-mcp/lib/local-branch.js:600 should stay mechanically synced with src/signals/test-evidence.ts; consider adding a short comment above isTestFile pointing at the canonical matcher so future changes update both copies.
  • test/unit/local-branch.test.ts:1766 could split the positive and negative path lists onto multiple lines to match the surrounding table-style classifier tests and make individual cases easier to review.
  • Readiness score is below the configured threshold — Use the readiness panel as advisory maintainer context; the score does not block this PR.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ⚠️ Missing No linked issue or no-issue rationale found.
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 (no linked issue context).
Validation posture ❌ 5/25 Preflight is holding this PR: the review lane is unavailable, so it is not ready for automated review.
Contributor workload ✅ 10/10 Author activity: 248 registered-repo PR(s), 152 merged, 10 issue(s).
Contributor context ✅ Confirmed Gittensor contributor glorydavid03023; Gittensor profile; 248 PR(s), 10 issue(s).
Gate result ✅ Passing No configured blocker found.
Review context
  • Author: glorydavid03023
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository registration is not available in the local Gittensory cache.
  • Public profile languages: Python, JavaScript, TypeScript, Rust, C++, Kotlin, MDX, Ruby
  • Official Gittensor activity: 248 PR(s), 10 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Explain no-issue PR.
  • Await review-lane availability.
  • Refresh registry data or choose a registered active repo.
  • Link the issue being solved, or explicitly explain why this is a no-issue PR.
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.

🟩 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 Gittensory, a quiet PR intelligence layer for OSS maintainers.

  • Re-run Gittensory review

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

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

@loopover-orb
loopover-orb Bot merged commit ce56de9 into JSONbored:main Jul 3, 2026
10 checks passed
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.

1 participant