Skip to content

fix(rag): index TypeScript .mts and .cts module sources#3341

Merged
gittensory-orb[bot] merged 1 commit into
JSONbored:mainfrom
jimcody1995:fix/rag-mts-cts-code-ext
Jul 5, 2026
Merged

fix(rag): index TypeScript .mts and .cts module sources#3341
gittensory-orb[bot] merged 1 commit into
JSONbored:mainfrom
jimcody1995:fix/rag-mts-cts-code-ext

Conversation

@jimcody1995

Copy link
Copy Markdown
Contributor

Summary

  • Add .mts and .cts to CODE_EXT_RE in src/review/rag.ts so RAG indexes TypeScript module sources instead of skipping them.
  • isCodeFile in signals/local-branch.ts already treats these as source; RAG was the outlier, so PRs touching only .mts/.cts files got no retrieved code context.

Scope

  • The PR title follows type(scope): short summary Conventional Commit format.
  • This PR is focused and does not mix unrelated changes.
  • This follows CONTRIBUTING.md.
  • Small enough that no linked issue is needed.

Validation

  • git diff --check
  • npm run test:ci (includes actionlint, typecheck, test:coverage, workers, MCP, UI checks)
  • npm audit --audit-level=moderate
  • Unit tests cover .mts/.cts classification, filePriority, and isIndexablePath

If any required check was skipped, explain why:

  • Full gate run as npm run test:ci on Node 22 before push.

Safety

  • No secrets or private data exposed.
  • No auth/API/UI behavior changes.
  • N/A for UI Evidence — backend RAG classifier only.

UI Evidence

N/A — no visible UI change.

Notes

Conflict avoidance: Touches only src/review/rag.ts and test/unit/rag.test.ts. Zero file overlap with open PRs (#3316 dart classifiers, #3304 mega, #3340 engine, #3339/#3338/#3337/#3333 enrichment, #3315/#3313/#3310 selfhost, #3314 miner, #3305 enrichment-wire, #3281 grafana, #3255 queue). Should merge cleanly after any of those land without rebase.

Made with Cursor

RAG skipped .mts/.cts while isCodeFile already counts them as source,
so PRs changing only module TypeScript got no code context. Align
CODE_EXT_RE with local-branch classifiers.

Co-authored-by: Cursor <cursoragent@cursor.com>
@jimcody1995 jimcody1995 requested a review from JSONbored as a code owner July 5, 2026 04:15
@superagent-security

Copy link
Copy Markdown

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

@gittensory-orb gittensory-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.5x multiplier. label Jul 5, 2026
@gittensory-orb

gittensory-orb Bot commented Jul 5, 2026

Copy link
Copy Markdown

Warning

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

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-07-05 04:19:53 UTC

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

⏸️ Suggested Action - Manual Review

Review summary
This is a focused RAG classifier parity fix: adding `mts` and `cts` to `CODE_EXT_RE` makes `classifyRepoFile`, `filePriority`, and `isIndexablePath` treat TypeScript module sources as code. The tests exercise the real exported classifier path rather than fabricating an impossible state, and the change matches the existing `.mts`/`.cts` handling in related source-file classifiers. I do not see a reachable correctness defect in this diff.

Nits — 3 non-blocking
  • nit: `test/unit/rag.test.ts:50` only checks `filePriority` for `.mts` and `isIndexablePath` for `.cts`; add the complementary assertions if you want the unit test to document both public helpers for both new extensions.
  • In `test/unit/rag.test.ts:50`, consider adding `expect(filePriority("src/setup.cts")).toBe(0);` and `expect(isIndexablePath("src/loader.mts")).toBe(true);` so the test states the intended behavior symmetrically for both 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: 46 registered-repo PR(s), 23 merged, 0 issue(s).
Contributor context ✅ Confirmed Gittensor contributor jimcody1995; Gittensor profile; 46 PR(s), 0 issue(s).
Gate result ✅ Passing No configured blocker found.
Review context
  • Author: jimcody1995
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository registration is not available in the local Gittensory cache.
  • Public profile languages: TypeScript, JavaScript
  • Official Gittensor activity: 46 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

@codecov

codecov Bot commented Jul 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.88%. Comparing base (01e96c6) to head (bb9d123).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3341   +/-   ##
=======================================
  Coverage   93.88%   93.88%           
=======================================
  Files         280      280           
  Lines       30534    30534           
  Branches    11120    11120           
=======================================
  Hits        28666    28666           
  Misses       1211     1211           
  Partials      657      657           
Files with missing lines Coverage Δ
src/review/rag.ts 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

@gittensory-orb gittensory-orb Bot merged commit 38a1bac into JSONbored:main Jul 5, 2026
8 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.5x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant