Skip to content

fix(signals): classify C# and Dart gRPC service stubs as generated - #3732

Closed
jimcody1995 wants to merge 1 commit into
JSONbored:mainfrom
jimcody1995:fix/signals-csharp-dart-grpc-generated
Closed

fix(signals): classify C# and Dart gRPC service stubs as generated#3732
jimcody1995 wants to merge 1 commit into
JSONbored:mainfrom
jimcody1995:fix/signals-csharp-dart-grpc-generated

Conversation

@jimcody1995

Copy link
Copy Markdown
Contributor

Summary

Extend isGeneratedFile to recognize:

  • Dart gRPC service stubs (.pbgrpc.dart) so generated Dart gRPC output is not misclassified as hand-authored source under the .dart code extension.
  • grpc-dotnet service stubs (*Grpc.cs) for parity with existing Java *Grpc.java, Kotlin GrpcKt.kt, and Swift .grpc.swift matchers.

Includes positive/negative isGeneratedFile / classifyChangedFile assertions and classification-table entries.

Fixes #3724

Scope

Validation

  • git diff --check
  • npm run test:ci on Node 22
  • npm audit --audit-level=moderate — 0 vulnerabilities
  • Unit tests cover isGeneratedFile, classifyChangedFile, and the representative cases table

If any required check was skipped, explain why:

  • None skipped.

Safety

  • No secrets, auth, or UI changes.
  • N/A for UI Evidence.

UI Evidence

N/A — signals-only change with no visible UI.

Notes

Advances #3724 by closing a generated-Dart gap: .pbgrpc.dart gRPC stubs now classify as generated via isGeneratedFile / classifyChangedFile, alongside existing .g.dart / .freezed.dart / .gr.dart recognition. C# *Grpc.cs is the same class of grpc-plugin service stub parity in the shared path-matcher module.

Does not change isCodeFile / MCP scoring mirrors — those are covered by the separate open PR for #3724 on local-branch.ts.

Conflict avoidance: Touches only src/signals/path-matchers.ts and test/unit/path-matchers.test.ts. Zero overlap with open PRs (#3724 local-branch scoring, #3718 finding severity floor, #3712 visual shot bounds, #3704 miner calibration types, #3702 miner README, #3698 ignored-author gate).

Made with Cursor

Recognize grpc-dotnet *Grpc.cs and Dart .pbgrpc.dart service stubs in
isGeneratedFile so generated-only diffs classify correctly for slop
signals and the changed-files summary classifier.

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

loopover-orb Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Warning

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

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-07-06 06:42:25 UTC

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

⏸️ Suggested Action - Manual Review

Review summary
This diff adds two narrow regex matchers to isGeneratedFileFrom in src/signals/path-matchers.ts: `/grpc\.cs$/` for grpc-dotnet service stubs and `/\.pbgrpc\.dart$/` for Dart gRPC stubs, directly paralleling the existing Java/Kotlin/Swift gRPC stub matchers just above them. Since isGeneratedFileFrom is checked before isCodeFile in classifyChangedFile, these new matches correctly take precedence over the `.cs`/`.dart` code-extension classification, and the added positive/negative unit tests plus classification-table entries exercise both the new matches and the surrounding non-matching cases (`src/Greeter.cs`, `lib/user.dart`). The change is narrowly scoped to the stated issue (#3724), touches only the two files described in the PR body, and follows the exact convention of the pre-existing `grpc\.java$`/`grpckt\.kt$` matchers.

Nits — 3 non-blocking
  • `/grpc\.cs$/` (src/signals/path-matchers.ts) has no boundary before 'grpc', so any hand-written file merely named e.g. `FooGrpc.cs` without being an actual grpc-dotnet stub would also classify as generated — this mirrors the pre-existing `grpc\.java$`/`grpckt\.kt$` matchers' same lack of boundary, so it's a pattern-consistency nit rather than a new defect.
  • The comment block above the regex list was extended appropriately, but consider a shared word-boundary/prefix convention comment (e.g. noting the plugin naming convention like `<ServiceName>Grpc.<ext>`) so future contributors don't need to infer intent from analogy alone.
  • None beyond the nits above — the diff is minimal, consistent with existing conventions, and adequately tested.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ Linked #3724
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 (1 linked issue).
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: 118 registered-repo PR(s), 84 merged, 0 issue(s).
Contributor context ✅ Confirmed Gittensor contributor jimcody1995; Gittensor profile; 118 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: 118 PR(s), 0 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Await review-lane availability.
  • Refresh registry data or choose a registered active repo.
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 6, 2026

Copy link
Copy Markdown
Contributor

Gittensory is closing this pull request on the maintainer's behalf (Linked issue #3724 is assigned to the maintainer (@JSONbored) — that work is reserved for the maintainer, so this PR cannot be auto-accepted.). 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.

1 participant