fix(signals): detect pytest test_*.py prefix as test evidence - #2666
Conversation
isTestPath recognized the *_test.py suffix but not pytest`s default and more common test_*.py prefix, so a Python PR adding test files next to source (mypackage/test_utils.py) was scored as having no test evidence — tripping the missing-test slop finding and undercounting test coverage. Add a path-segment-anchored test_*.py matcher; latest_config.py and testing.py stay non-tests.
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-03 02:36:39 UTC
⏸️ Suggested Action - Manual Review Review summary Nits — 4 non-blocking
Review context
Contributor next steps
Signal definitions
🟩 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.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2666 +/- ##
=======================================
Coverage 96.10% 96.10%
=======================================
Files 237 237
Lines 26540 26540
Branches 9625 9625
=======================================
Hits 25507 25507
Misses 424 424
Partials 609 609
🚀 New features to boost your workflow:
|
…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.
… 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.
… 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.
… 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.
… 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.
isTestPath recognized the
*_test.pysuffix but not pytests default and more commontest_*.py**prefix**. A Python PR that adds test files next to source (e.g.mypackage/test_utils.py,src/app/test_auth.py) matched no branch ofisTestPathand was scored as shipping **no** test evidence — tripping the missing-test slop finding and undercountingclassifyTestCoverage` / the local scorer.test_*.pyis the defaultpython_filespattern for pytest (and matches unittest discovery), so this is the primary Python test convention, not an edge case. The existing dir-based branch only catches files that live under atest/,tests/,spec/, or__tests__/directory, which the flat pytest layout does not.Fix
Add one path-segment-anchored matcher next to the existing suffix rule:
The
(^|\/)anchor keeps it precise:latest_config.pyandtesting.pyremain non-tests (notest_at a segment boundary), while the pre-existing*_test.pysuffix form is untouched.Tests
Adds a regression case covering the prefix form, the still-working suffix form, and both non-test negatives. Verified the new case FAILS on current
mainand PASSES with the fix; the fulltest-evidence,slop, andpath-matcherssuites stay green.No linked issue: issue creation is unavailable for this account.