fix(signals): exclude generated Dart part files from code scoring - #3724
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
gittensory-ui | 870e906 | Commit Preview URL Branch Preview URL |
Jul 06 2026, 09:34 AM |
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-06 08:02:43 UTC
⏸️ Suggested Action - Manual Review
Review summary Nits — 5 non-blocking
Concerns raised — review before merging
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.
|
Dart build_runner/freezed/retrofit part files (*.g.dart, *.freezed.dart, *.gr.dart) were being classified as hand-authored source across every independent code-file classifier -- the TS engine (now centralized in path-matchers.ts's isCodeFile), the MCP package's standalone JS copy, and both the .mjs and Python gittensor-score-preview scripts -- so a PR that's mostly generated Dart boilerplate scored as if it were real work. Excludes the three generated-part-file suffixes from isCodeFile in each of the four classifiers, matching the existing pattern already used for other codegen (protobuf, C# designer partials, source maps).
f8bfe00 to
870e906
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3724 +/- ##
=======================================
Coverage 93.30% 93.30%
=======================================
Files 317 317
Lines 32384 32384
Branches 11876 11876
=======================================
Hits 30215 30215
Misses 1537 1537
Partials 632 632
🚀 New features to boost your workflow:
|
Motivation
.dartto the broad code-extension classifier but did not exclude generated Dart part files, causing.g.dart/.freezed.dart/.gr.dartto be counted as source in local scoring and preview scripts.sourceTokenScore/sourceLines.Description
isCodeFileto use aCODE_FILE_REand explicitly exclude generated Dart parts viaGENERATED_CODE_FILE_REso hand-authored.dartremains source while.g.dart/.freezed.dart/.gr.dartare non-code (src/signals/local-branch.ts).isGeneratedCodeFile/is_generated_code_fileguards inpackages/gittensory-mcp/lib/local-branch.js,packages/gittensory-mcp/scripts/gittensor-score-preview.mjs, andpackages/gittensory-mcp/scripts/gittensor-score-preview.py.test/unit/local-branch-file-classifiers.test.ts,test/unit/local-scorer.test.ts,test/unit/score-preview-script.test.ts, and updates intest/unit/local-branch.test.ts).Testing
npx vitest run test/unit/local-branch-file-classifiers.test.ts test/unit/local-scorer.test.ts test/unit/score-preview-script.test.ts test/unit/local-branch.test.ts, and all tests in those files passed.git diff --checkreturned clean results andnpm run build:mcpcompleted successfully to validate the packaged MCP scripts.npm run test:ci, but the run in this environment encountered long-running queue-test activity and transientactionlint/ network DNS issues that prevented completion; this is unrelated to the classifier change.npm audit --audit-level=moderate, but the environment returned a403from the npm audit endpoint so the dependency-review step could not be exercised here.Codex Task