Skip to content

fix(signals): classify Vue/Svelte/Astro source files as code#3282

Closed
jimcody1995 wants to merge 1 commit into
JSONbored:mainfrom
jimcody1995:fix/signals-vue-svelte-astro-code-v2
Closed

fix(signals): classify Vue/Svelte/Astro source files as code#3282
jimcody1995 wants to merge 1 commit into
JSONbored:mainfrom
jimcody1995:fix/signals-vue-svelte-astro-code-v2

Conversation

@jimcody1995

Copy link
Copy Markdown
Contributor

Summary

Vue, Svelte, and Astro source files were already treated as code by the RAG indexer (review/rag.ts CODE_EXT_RE) and the visual-path classifier (review/visual/paths.ts), but isCodeFile did not recognize them. That mismatch meant front-end framework changes could be misclassified as non-code in slop signals, missing-tests checks, and the MCP local score preview.

This PR extends isCodeFile (and the mirrored MCP classifiers) to include .vue, .svelte, and .astro extensions, with regression tests in the classifier suite, MCP parity test, and score-preview script tests.

No linked issue — small classifier parity fix with clear product impact.

Conflict avoidance: This PR touches only src/signals/{local-branch,engine}.ts, MCP score-preview mirrors, and related unit tests. None of the four currently open PRs (#3278, #3273, #3269, #3255) modify these paths, so it should merge cleanly even after those land.

Scope

  • The PR title follows type(scope): short summary Conventional Commit format, for example fix(api): restore profile access checks.
  • This PR is focused and does not mix unrelated backend, UI, MCP, docs, dependency, and deploy changes.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • I linked an issue, or this is small enough that the summary explains why an issue is not needed.

Validation

  • git diff --check
  • npm run actionlint
  • npm run typecheck
  • npm run test:coverage locally; codecov/patch requires ≥99% coverage of the lines AND branches you changed (aim for 100% on your diff so CI variance does not fail near the threshold). Global coverage is a non-blocking trend with a loose 90% backstop, not the gate.
  • npm run test:workers
  • npm run build:mcp
  • npm run test:mcp-pack
  • npm run ui:openapi:check
  • npm run ui:lint
  • npm run ui:typecheck
  • npm run ui:build
  • npm audit --audit-level=moderate
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries

If any required check was skipped, explain why:

  • None skipped. Full npm run test:ci and npm audit --audit-level=moderate both passed locally on latest main (commit d9dfcf8).

Safety

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise, and does not imply compensation guarantees or optimization tactics.
  • Auth, cookie, CORS, GitHub App, Cloudflare, or session changes include negative-path tests.
  • API/OpenAPI/MCP behavior is updated and tested where needed.
  • UI changes use live API data or real empty/error/loading states, not production mock/demo fallbacks.
  • Visible UI changes include a UI Evidence section below with JPG/JPEG or PNG screenshots arranged as organized, captioned, clickable thumbnails. SVG screenshots are not used as review evidence. Review-only screenshots or recordings are not committed to the repository.
  • Public docs/changelogs are updated where needed; changelogs are only edited for release-prep PRs.

UI Evidence

N/A — no visible UI change.

Notes

  • Keeps isCodeFile in local-branch.ts, engine.ts, and the MCP score-preview mirrors (.mjs, .py, local-branch.js) in sync.
  • Added MCP parity coverage in local-branch.test.ts and score-preview-script.test.ts for both .mjs and .py paths.

Align isCodeFile with review/rag.ts CODE_EXT_RE and review/visual/paths.ts
so front-end framework source is counted as genuine code in slop signals,
missing-tests checks, and the MCP local score preview mirrors.

Co-authored-by: Cursor <cursoragent@cursor.com>
@jimcody1995
jimcody1995 requested a review from JSONbored as a code owner July 5, 2026 00:39
@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 5, 2026
@loopover-orb

loopover-orb Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Caution

🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥

🛑 Gittensory review result - reject/close recommended

Review updated: 2026-07-05 00:41:17 UTC

8 files · 1 AI reviewer · 1 blocker · readiness 73/100 · CI pending · blocked

🛑 Suggested Action - Reject/Close

  • AI reviewers agree on a likely critical defect: src/rules/advisory.ts:isCodePath still excludes `.vue`, `.svelte`, and `.astro`, so `buildCheckRunAnnotations` filters those files out before the new `isCodeFile` predicate can classify them and the missing-test annotation path remains broken for exactly the framework files this PR is meant to fix. — Resolve the flagged defect, or override if the AI reviewers are mistaken, then re-run the gate.

Review summary
This PR correctly extends the main TypeScript classifier and the MCP preview mirrors so `.vue`, `.svelte`, and `.astro` files count as source instead of non-code. The core regex changes are straightforward and the added tests cover the local and preview classifier paths, but the visible related annotation path still has its own code-path prefilter that excludes these extensions before `isCodeFile` can run. That leaves one missing-tests/check-annotation path out of parity with the stated fix.

Blockers

  • src/rules/advisory.ts:isCodePath still excludes `.vue`, `.svelte`, and `.astro`, so `buildCheckRunAnnotations` filters those files out before the new `isCodeFile` predicate can classify them and the missing-test annotation path remains broken for exactly the framework files this PR is meant to fix.
Nits — 5 non-blocking
  • test/unit/score-preview-script.test.ts: the Python parity assertion silently returns when Python is unavailable, so the `.py` mirror can regress in that environment without this new test proving it.
  • Update `src/rules/advisory.ts:isCodePath` to include `vue|svelte|astro`, or tell me why check-run missing-test annotations are intentionally not part of this parity fix.
  • Add a focused annotation-level regression that drives a Vue/Svelte/Astro file through `buildCheckRunAnnotations` and proves it is eligible for the missing-test warning path.
  • Consider using the existing Python-skip convention only if this file already has one; otherwise make the skipped Python preview explicit so it is visible when parity was not exercised.
  • Readiness score is below the configured threshold — Use the readiness panel as advisory maintainer context; the score does not block this PR.

Why this is blocked

  • src/rules/advisory.ts:isCodePath still excludes `.vue`, `.svelte`, and `.astro`, so `buildCheckRunAnnotations` filters those files out before the new `isCodeFile` predicate can classify them and the missing-test annotation path remains broken for exactly the framework files this PR is meant to fix.
Signal Result Evidence
Code review ❌ 1 blocker 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: 28 registered-repo PR(s), 12 merged, 0 issue(s).
Contributor context ✅ Confirmed Gittensor contributor jimcody1995; Gittensor profile; 28 PR(s), 0 issue(s).
Gate result ❌ Blocking Repo-configured hard 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: not available
  • Official Gittensor activity: 28 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

@loopover-orb

loopover-orb Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Gittensory is closing this pull request on the maintainer's behalf (AI reviewers agree on a likely critical defect: src/rules/advisory.ts:isCodePath still excludes `.vue`, `.svelte`, and `.astro`, so `buildCheckRunAnnotations` filters those files out before the new `isCodeFile` predicate can classify them and the missing-test annotation path remains broken for exactly the framework files this PR is meant to fix.). 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.

@loopover-orb loopover-orb Bot closed this Jul 5, 2026
@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 94.13%. Comparing base (d9dfcf8) to head (02e2683).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3282   +/-   ##
=======================================
  Coverage   94.13%   94.13%           
=======================================
  Files         276      276           
  Lines       30204    30204           
  Branches    11011    11011           
=======================================
  Hits        28432    28432           
  Misses       1127     1127           
  Partials      645      645           
Files with missing lines Coverage Δ
src/signals/engine.ts 97.35% <100.00%> (ø)
src/signals/local-branch.ts 97.21% <100.00%> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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