Skip to content

fix(rules): align isCodePath with isCodeFile for mts/cts/mjs/cjs/kts/scala/groovy - #9327

Closed
philluiz2323 wants to merge 1 commit into
JSONbored:mainfrom
philluiz2323:fix/9322-is-codepath-extension-parity
Closed

fix(rules): align isCodePath with isCodeFile for mts/cts/mjs/cjs/kts/scala/groovy#9327
philluiz2323 wants to merge 1 commit into
JSONbored:mainfrom
philluiz2323:fix/9322-is-codepath-extension-parity

Conversation

@philluiz2323

Copy link
Copy Markdown
Contributor

Problem

Closes #9322.

isCodePath in src/rules/advisory.ts is meant to mirror isCodeFile for check-run annotation gating, but its extension regex still excluded .mts, .cts, .mjs, .cjs, .kts, .scala, and .groovy that isSourcePath already recognizes — so missing-test annotations were silently skipped for those source files.

Fix

Extend isCodePath's extension list to include the same JVM/JS module extensions isSourcePath uses.

Tests

  • New parity regression test (mirroring the existing Vue/C++/Dart cases) asserting missing-test annotations fire for .mts/.cts/.mjs/.cjs/.kts/.scala/.groovy paths.

Reverting the regex extension fails the test. git diff --check clean.

Validation

  • vitest run test/unit/rules.test.ts -t 9322
  • Rules/advisory-only; unrelated UI/MCP checks not exercised.

Safety

  • No secrets exposed; no UI changes (N/A evidence)

…scala/groovy

isCodePath in advisory.ts fell behind isSourcePath's extension set, so missing-test
check-run annotations skipped .mts/.cts/.mjs/.cjs/.kts/.scala/.groovy source
files that isCodeFile already classifies as genuine source. Extend the regex
to match isSourcePath and add a parity regression test mirroring JSONbored#1576/JSONbored#1599/JSONbored#1620.

Closes JSONbored#9322
@philluiz2323
philluiz2323 requested a review from JSONbored as a code owner July 27, 2026 13:12
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

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

loopover-orb Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Caution

🛑 LoopOver review result - fixes required

Review updated: 2026-07-27 13:22:53 UTC

2 files · 1 AI reviewer · no blockers · CI failing · unstable

🛑 Suggested Action - Fix Blockers

Review summary
This is a narrow, well-targeted regex fix: isCodePath's extension list is extended to match isSourcePath's/isCodeFile's set of recognized JVM/JS module extensions (.mts/.cts/.mjs/.cjs/.kts/.scala/.groovy), closing the gap where missing-test annotations were silently skipped for those file types. The diff is minimal (regex change + a parity regression test mirroring the existing pattern in the same file), directly tied to the linked issue #9322, and the added test exercises the real buildCheckRunAnnotations path rather than a fabricated one.

Nits — 3 non-blocking

CI checks failing

  • validate
  • validate-tests

Decision drivers

  • ✅ Code review — No blockers (1 reviewer)
  • ✅ Gate result — Passing (No configured blocker found.)
Context & advisory signals — never blocks the verdict
Signal Result Evidence
Linked issue ✅ Linked #9322
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ❌ 8/20 High review scope from cached public metadata (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 989 registered-repo PR(s), 564 merged, 125 issue(s).
Contributor context ✅ Confirmed Gittensor contributor philluiz2323; Gittensor profile; 989 PR(s), 125 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: moderate
Linked issue satisfaction

Addressed
The diff adds exactly the seven missing extensions (.mts/.cts/.mjs/.cjs/.kts/.scala/.groovy) to isCodePath's regex without removing any existing ones, and adds a regression test covering all seven paths asserting a Missing test evidence annotation via buildCheckRunAnnotations, matching the requested style.

Review context
  • Author: philluiz2323
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: Python, JavaScript, MDX, TypeScript, CSS, Cuda, HTML, Kotlin
  • Official Gittensor activity: 989 PR(s), 125 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Start here: Add a concise scope and risk note.
  • Then work through the remaining 2 steps in the Signals table above.
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.
🧪 Chat with LoopOver

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

  • @loopover ask <question> answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat <question> answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @loopover mention with a real question is routed to the closest matching read-only command automatically — no exact syntax required.

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.

  • Re-run LoopOver review

@loopover-orb

loopover-orb Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

LoopOver is closing this pull request on the maintainer's behalf (CI is failing (validate, validate-tests)). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed.

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.

fix(rules): advisory.ts's isCodePath is missing .mts/.cts/.mjs/.cjs/.kts/.scala/.groovy that isCodeFile recognizes

1 participant