Skip to content

fix(signals): detect JVM/C#/Swift class-suffix test conventions - #2743

Merged
JSONbored merged 1 commit into
JSONbored:mainfrom
jeffrey701:fix/test-evidence-jvm-conventions
Jul 3, 2026
Merged

fix(signals): detect JVM/C#/Swift class-suffix test conventions#2743
JSONbored merged 1 commit into
JSONbored:mainfrom
jeffrey701:fix/test-evidence-jvm-conventions

Conversation

@jeffrey701

Copy link
Copy Markdown
Contributor

Summary

isTestPath recognized JS/TS/Go/Python/Ruby/Cypress test files, but had no rule for the PascalCase class-suffix convention used across the JVM and adjacent ecosystems — JUnit (FooTest.java), Kotlin (FooTests.kt), ScalaTest (FooSpec.scala), Spock (FooSpec.groovy), xUnit/NUnit (FooTests.cs), and XCTest (FooTests.swift). Outside a test/ directory those files were misclassified as source, understating a PR's test evidence.

Adds a case-sensitive \w*(Tests?|Spec)\.(java|kt|kts|scala|cs|swift|groovy) rule — case-sensitive so it cannot false-positive on words that merely end in test/spec (Latest.java, Contest.cs, manifest.scala).

Validation

  • npx vitest run test/unit/test-evidence.test.ts — green (positives + false-positive cases)
  • npm run typecheck — clean

isTestPath recognized JS/TS/Go/Python/Ruby/Cypress test files, but had no
rule for the PascalCase class-suffix convention used across the JVM and
adjacent ecosystems — JUnit (FooTest.java), Kotlin (FooTests.kt), ScalaTest
(FooSpec.scala), Spock (FooSpec.groovy), xUnit/NUnit (FooTests.cs), and XCTest
(FooTests.swift). Those files (when not under a test/ directory) were
misclassified as source, understating a PR's test evidence.

Add a case-sensitive `\w*(Tests?|Spec)\.(java|kt|kts|scala|cs|swift|groovy)`
rule so the PascalCase suffix can't false-positive on words that merely end
in test/spec (Latest.java, Contest.cs, manifest.scala). Covered with positive
and false-positive cases.
@jeffrey701
jeffrey701 requested a review from JSONbored as a code owner July 3, 2026 09:58
@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.03%. Comparing base (3ca27bb) to head (511ee9b).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2743   +/-   ##
=======================================
  Coverage   96.03%   96.03%           
=======================================
  Files         245      245           
  Lines       27340    27340           
  Branches     9930     9930           
=======================================
  Hits        26255    26255           
  Misses        460      460           
  Partials      625      625           
Files with missing lines Coverage Δ
src/signals/test-evidence.ts 100.00% <ø> (ø)
🚀 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 10:55:00 UTC

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

⏸️ Suggested Action - Manual Review

Review summary
The change extends `isTestPath` with a focused class-suffix rule for JVM/C#/Swift-style test files and adds direct positive and false-positive coverage for the new behavior. The regex is scoped to the intended extensions and keeps the suffix case-sensitive, so the visible change does not introduce a broad lookalike-path regression. The most notable follow-up is keeping the delegated `local-branch` classifier coverage in sync with this expanded definition.

Nits — 3 non-blocking
  • nit: `test/unit/local-branch-file-classifiers.test.ts` should add one delegated JVM/C#/Swift suffix case so `isCodeFile`/`isTestFile` coverage documents that these files stop counting as source through the shared `isTestPath` path.
  • Add a delegated regression in `test/unit/local-branch-file-classifiers.test.ts`, for example asserting `isTestFile("app/src/main/java/WidgetTest.java") === true` and `isCodeFile("app/src/main/java/WidgetTest.java") === false`, matching the existing shared-classifier convention.
  • 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: 40 registered-repo PR(s), 20 merged, 0 issue(s).
Contributor context ✅ Confirmed Gittensor contributor jeffrey701; Gittensor profile; 40 PR(s), 0 issue(s).
Gate result ✅ Passing No configured blocker found.
Review context
  • Author: jeffrey701
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository registration is not available in the local Gittensory cache.
  • Public profile languages: not available
  • Official Gittensor activity: 40 PR(s), 0 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

@JSONbored
JSONbored merged commit b61b894 into JSONbored:main Jul 3, 2026
9 checks passed
loopover-orb Bot pushed a commit that referenced this pull request Jul 3, 2026
…x + JVM/C#/Swift) (#2753)

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 (#2666) and the JVM/C#/Swift
`SomethingTest(s)`/`Spec` class-suffix (#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.
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.

2 participants