Skip to content

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

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
jimcody1995:fix/signals-csharp-dart-grpc-generated
Jul 6, 2026
Merged

fix(signals): classify C# and Dart gRPC service stubs as generated#3735
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
jimcody1995:fix/signals-csharp-dart-grpc-generated

Conversation

@jimcody1995

Copy link
Copy Markdown
Contributor

Summary

Extend isGeneratedFile to recognize grpc-dotnet service stubs (*Grpc.cs) and Dart gRPC service stubs (.pbgrpc.dart), matching the existing Java/Kotlin/Swift gRPC stub matchers. Accurate generated-file classification is a prerequisite for distinguishing generated-only diffs from hand-authored source when calibrating PR scope.

Fixes #3005

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

Incremental path-matcher parity for #3005: grpc C#/Dart protobuf service stubs now classify as generated via classifyChangedFile, so slop signals and scope heuristics do not treat machine-generated gRPC output as substantive hand-authored source.

Does not deliver the miner driver prompt calibration slice — only closes a generated-classification gap in the shared path-matcher module.

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:46
@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:53:22 UTC

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

⏸️ Suggested Action - Manual Review

Review summary
This PR adds two narrowly-scoped regex matchers to isGeneratedFileFrom in src/signals/path-matchers.ts: /grpc\.cs$/ for grpc-dotnet service stubs and /\.pbgrpc\.dart$/ for Dart gRPC service stubs, mirroring the existing Java/Kotlin/Swift gRPC stub patterns. The change is correctly scoped (regex + comment + tests only), doesn't touch schema or config wiring, and the new tests exercise both true-positive (GreeterGrpc.cs, foo.pbgrpc.dart) and true-negative (Greeter.cs, user.dart) cases plus the classifyChangedFile table. It closes a real classification gap referenced by issue #3005, though per the PR's own notes it only delivers a slice of that issue (generated-file parity), not the full miner-calibration work.

Nits — 3 non-blocking
  • The new /grpc\.cs$/ pattern will also match a hand-authored file literally named e.g. `MyGrpc.cs` that isn't an actual service stub, same latent false-positive risk the pre-existing Java (`grpc\.java$`) and Kotlin (`grpckt\.kt$`) matchers already accept — worth a one-line acknowledgment in the comment since it's now been extended to a third language.
  • No test covers that false-positive edge case (a non-stub file whose name happens to end in `Grpc.cs`), which would make the accepted tradeoff explicit alongside the existing GreeterGrpc.java pattern's tests.
  • Consider a shared regex fragment like `/(^|\/)[^/]*Grpc\.(java|cs)$/` style comment note to make clear this is a deliberate, accepted heuristic rather than an oversight, matching the tone of the surrounding comments in path-matchers.ts.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ Linked #3005
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 left a comment

Copy link
Copy Markdown
Contributor

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.

@loopover-orb
loopover-orb Bot merged commit 12a0d96 into JSONbored:main Jul 6, 2026
18 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.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(miner): calibrate generated PR scope and style to the target repo's observable merge-bar

1 participant