Skip to content

fix(signals): count C#/Swift/Groovy source as code files#2776

Merged
loopover-orb[bot] merged 5 commits into
JSONbored:mainfrom
jeffrey701:fix/iscodefile-jvm-languages
Jul 3, 2026
Merged

fix(signals): count C#/Swift/Groovy source as code files#2776
loopover-orb[bot] merged 5 commits into
JSONbored:mainfrom
jeffrey701:fix/iscodefile-jvm-languages

Conversation

@jeffrey701

Copy link
Copy Markdown
Contributor

Summary

isCodeFile recognized the JVM trio (kt/scala/java) plus go/rust/python, but not cs/swift/groovy — even though isTestPath already recognizes their SomethingTest(s)/Spec test files. So a C#/Swift/Groovy source file was classified as neither test nor code by the local scorer, understating real source effort while its test counterpart still counted as a test.

Adds cs/swift/groovy to both isCodeFile copies (local-branch.ts + engine.ts, kept in sync).

Validation

  • npx vitest run test/unit/local-branch-file-classifiers.test.ts test/unit/local-branch.test.ts — green (source-as-code + test-still-excluded)
  • npm run typecheck — clean

isCodeFile recognized the JVM trio (kt/scala/java) plus go/rust/python, but
not cs/swift/groovy — even though isTestPath already recognizes their
SomethingTest(s)/Spec test files. So a C#/Swift/Groovy source file was
classified as neither test nor code by the local scorer, understating real
source effort while its test counterpart still counted as a test.

Add cs/swift/groovy to both isCodeFile copies (local-branch.ts + engine.ts,
kept in sync) so their source counts as code, and cover the source-as-code
plus test-still-excluded cases.
@jeffrey701
jeffrey701 requested a review from JSONbored as a code owner July 3, 2026 12:28
@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.12%. Comparing base (562f5dd) to head (117b325).
⚠️ Report is 11 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2776   +/-   ##
=======================================
  Coverage   96.12%   96.12%           
=======================================
  Files         248      248           
  Lines       27548    27550    +2     
  Branches    10007    10007           
=======================================
+ Hits        26480    26483    +3     
  Misses        443      443           
+ Partials      625      624    -1     
Files with missing lines Coverage Δ
src/signals/engine.ts 97.35% <100.00%> (+<0.01%) ⬆️
src/signals/local-branch.ts 97.21% <100.00%> (+<0.01%) ⬆️

... and 1 file with indirect coverage changes

🚀 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

Warning

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

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-07-03 19:43:59 UTC

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

⏸️ Suggested Action - Manual Review

Review summary
The diff extends the code-file classifiers in both signal paths and the MCP preview scripts so `.cs`, `.swift`, and `.groovy` source files contribute to source lines while PascalCase test files stay out of source. The ordering remains correct because each code classifier still checks `isTestFile`/`is_test_file` before assigning source status, so the visible change is safe to proceed. The main remaining gap is regression coverage around Groovy test-file exclusion and the standalone preview-script classifiers.

Nits — 5 non-blocking
  • nit: test/unit/local-branch-file-classifiers.test.ts:138 adds C#/Swift test-exclusion cases but not a Groovy `Spec`/`Test` case, leaving one newly recognized extension without a regression test on the test-file side.
  • nit: packages/gittensory-mcp/scripts/gittensor-score-preview.py:15 and packages/gittensory-mcp/scripts/gittensor-score-preview.mjs:11 duplicate the suffix-extension list separately from the signal classifiers, so future classifier updates still have to be kept in sync manually.
  • Add a false-case fixture such as `src/main/groovy/PipelineSpec.groovy` or `src/test/groovy/PipelineTest.groovy` beside the new C#/Swift exclusions in test/unit/local-branch-file-classifiers.test.ts:138.
  • Add a small regression test or fixture for packages/gittensory-mcp/scripts/gittensor-score-preview.py:160 and packages/gittensory-mcp/scripts/gittensor-score-preview.mjs:15 covering source-vs-test classification for the three added extensions.
  • 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: 49 registered-repo PR(s), 24 merged, 0 issue(s).
Contributor context ✅ Confirmed Gittensor contributor jeffrey701; Gittensor profile; 49 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: Clojure, TypeScript
  • Official Gittensor activity: 49 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

The MCP score-preview scorer (gittensor-score-preview.mjs) and its Python
metadata-fallback (gittensor-score-preview.py) carry their own copies of the
code-extension list; add cs/swift/groovy there too so C#/Swift/Groovy source
counts as code on every scoring path, matching the signal classifiers.
Recognizing cs/swift/groovy as code in the preview scorers meant their
PascalCase test classes (AccountTests.cs, LoginTests.swift) were counted as
source. Add the case-sensitive `SomethingTest(s)/Spec` suffix rule to the
.mjs isTestFile and the .py is_test_file so those test files are excluded from
code, matching the signal classifiers (Latest.cs/Contest.cs stay code).
…sifiers

lib/local-branch.js carries committed copies of isCodeFile/isTestFile; add
cs/swift/groovy to isCodeFile and the JVM/C#/Swift PascalCase test suffix to
isTestFile so every classifier copy agrees (C#/Swift/Groovy source counts as
code, their test classes stay tests).
…languages

# Conflicts:
#	packages/gittensory-mcp/lib/local-branch.js

@loopover-orb loopover-orb Bot left a comment

Copy link
Copy Markdown

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 f72bcf0 into JSONbored:main Jul 3, 2026
10 checks passed
glorydavid03023 added a commit to glorydavid03023/gittensory that referenced this pull request Jul 3, 2026
… conventions

The local score-preview scripts inline their own test/code classifiers (they ship
in the standalone Node bin package and can't import from src/). Both had drifted
from the canonical isTestPath/isCodeFile: the .mjs and .py test detectors missed
the pytest `test_*.py` prefix (JSONbored#2666), the Cypress/Playwright `*.cy.*`/`*.e2e.*`
convention and `__snapshots__` dirs (JSONbored#2665); the `.mjs` isCodeFile and the `.py`
metadata_fallback source-extension tuple both missed the `.mts/.cts/.mjs/.cjs`
module extensions.

So a miner's LOCAL preview classified a `.mts` source file as non-code and a
Cypress/pytest test as source — disagreeing with the gate's own source/test split
and skewing the previewed token scores. (JSONbored#2776 already re-synced these scripts'
C#/Swift/Groovy code extensions; this closes the older test-convention + module-
extension gaps.)

Bring both scripts' classifiers to parity with isTestPath/isCodeFile. Adds a
spawn-based regression running the real .mjs (and the .py metadata_fallback when
python is available) over module-ext/Cypress/pytest files.
glorydavid03023 added a commit to glorydavid03023/gittensory that referenced this pull request Jul 3, 2026
… conventions

The local score-preview scripts inline their own test/code classifiers (they ship
in the standalone Node bin package and can't import from src/). Both had drifted
from the canonical isTestPath/isCodeFile: the .mjs and .py test detectors missed
the pytest `test_*.py` prefix (JSONbored#2666), the Cypress/Playwright `*.cy.*`/`*.e2e.*`
convention and `__snapshots__` dirs (JSONbored#2665); the `.mjs` isCodeFile and the `.py`
metadata_fallback source-extension tuple both missed the `.mts/.cts/.mjs/.cjs`
module extensions.

So a miner's LOCAL preview classified a `.mts` source file as non-code and a
Cypress/pytest test as source — disagreeing with the gate's own source/test split
and skewing the previewed token scores. (JSONbored#2776 already re-synced these scripts'
C#/Swift/Groovy code extensions; this closes the older test-convention + module-
extension gaps.)

Bring both scripts' classifiers to parity with isTestPath/isCodeFile. Adds a
spawn-based regression running the real .mjs (and the .py metadata_fallback when
python is available) over module-ext/Cypress/pytest files.
glorydavid03023 added a commit to glorydavid03023/gittensory that referenced this pull request Jul 3, 2026
… conventions

The local score-preview scripts inline their own test/code classifiers (they ship
in the standalone Node bin package and can't import from src/). Both had drifted
from the canonical isTestPath/isCodeFile: the .mjs and .py test detectors missed
the pytest `test_*.py` prefix (JSONbored#2666), the Cypress/Playwright `*.cy.*`/`*.e2e.*`
convention and `__snapshots__` dirs (JSONbored#2665); the `.mjs` isCodeFile and the `.py`
metadata_fallback source-extension tuple both missed the `.mts/.cts/.mjs/.cjs`
module extensions.

So a miner's LOCAL preview classified a `.mts` source file as non-code and a
Cypress/pytest test as source — disagreeing with the gate's own source/test split
and skewing the previewed token scores. (JSONbored#2776 already re-synced these scripts'
C#/Swift/Groovy code extensions; this closes the older test-convention + module-
extension gaps.)

Bring both scripts' classifiers to parity with isTestPath/isCodeFile. Adds a
spawn-based regression running the real .mjs (and the .py metadata_fallback when
python is available) over module-ext/Cypress/pytest files.
loopover-orb Bot pushed a commit that referenced this pull request Jul 3, 2026
… conventions (#2822)

The local score-preview scripts inline their own test/code classifiers (they ship
in the standalone Node bin package and can't import from src/). Both had drifted
from the canonical isTestPath/isCodeFile: the .mjs and .py test detectors missed
the pytest `test_*.py` prefix (#2666), the Cypress/Playwright `*.cy.*`/`*.e2e.*`
convention and `__snapshots__` dirs (#2665); the `.mjs` isCodeFile and the `.py`
metadata_fallback source-extension tuple both missed the `.mts/.cts/.mjs/.cjs`
module extensions.

So a miner's LOCAL preview classified a `.mts` source file as non-code and a
Cypress/pytest test as source — disagreeing with the gate's own source/test split
and skewing the previewed token scores. (#2776 already re-synced these scripts'
C#/Swift/Groovy code extensions; this closes the older test-convention + module-
extension gaps.)

Bring both scripts' classifiers to parity with isTestPath/isCodeFile. Adds a
spawn-based regression running the real .mjs (and the .py metadata_fallback when
python is available) over module-ext/Cypress/pytest files.
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