Skip to content

fix(signals): classify PHP gRPC service stubs as generated#3754

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

fix(signals): classify PHP gRPC service stubs as generated#3754
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
jimcody1995:fix/signals-php-grpc-generated

Conversation

@jimcody1995

Copy link
Copy Markdown
Contributor

Summary

Extend isGeneratedFile to recognize grpc-php service stubs (*Grpc.php, *GrpcStub.php), matching the existing *_pb.php / *_grpc_pb.php protobuf matchers and the Java/C#/Dart gRPC stub conventions. Includes positive/negative isGeneratedFile / classifyChangedFile assertions and classification-table entries.

Fixes #3007

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 #3007: PHP gRPC service stubs now classify as generated via classifyChangedFile, so slop signals and pre-open_pr heuristics do not treat machine-generated grpc-php output as hand-authored source.

Does not deliver the late-binding freshness-check 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 (#3748 changed-files summary test, #3741 deps, #3724 local-branch Dart scoring, #3721 automated-review skip hold, #3712 visual shot bounds, #3704 miner calibration types, #3698 ignored-author gate).

Made with Cursor

Recognize grpc-php *Grpc.php and *GrpcStub.php service stubs in
isGeneratedFile alongside existing *_pb.php and *_grpc_pb.php matchers.

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

Copy link
Copy Markdown
Contributor

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

@codecov

codecov Bot commented Jul 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.30%. Comparing base (19404a4) to head (3922b33).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3754   +/-   ##
=======================================
  Coverage   93.30%   93.30%           
=======================================
  Files         317      317           
  Lines       32363    32363           
  Branches    11873    11873           
=======================================
  Hits        30195    30195           
  Misses       1537     1537           
  Partials      631      631           
Files with missing lines Coverage Δ
src/signals/path-matchers.ts 89.09% <ø> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@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

Tip

🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩

✅ Gittensory review result - approve/merge recommended

Review updated: 2026-07-06 07:36:54 UTC

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

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This PR extends `isGeneratedFileFrom` in src/signals/path-matchers.ts to classify PHP gRPC service stubs (`*Grpc.php`, `*GrpcStub.php`) as generated, mirroring the existing Java/C#/Dart gRPC stub conventions already in the same function. The regexes are correctly ordered relative to normalization (norm is already lowercased in normalizeForMatch, so the bare `/grpc\.php$/` and case-insensitive `/grpcstub\.php$/i` both work as intended), and the added test cases (`GreeterGrpc.php`, `FooGrpcStub.php`) correctly exercise both new branches in isGeneratedFile, classifyChangedFile, and the classification table. This is a narrow, low-risk, well-tested path-matcher addition with no schema/migration/wiring implications.

Nits — 4 non-blocking
  • src/signals/path-matchers.ts: the new `/grpcstub\.php$/i` carries a redundant `i` flag while the sibling `/grpc\.php$/` doesn't — since `norm` is already lowercased by normalizeForMatch, drop the flag for consistency with the rest of the function.
  • The `*Grpc.php`/`*GrpcStub.php` convention covers only two of protoc-gen-grpc-php's possible output shapes; worth double-checking whether other common generated-client naming variants (e.g. `*Client.php`) from that plugin are also emitted and left unclassified, though that's out of scope for this incremental fix.
  • src/signals/path-matchers.ts: consider consolidating `/grpc\.php$/` and `/grpcstub\.php$/i` into a single alternation (e.g. `/grpc(stub)?\.php$/`) for brevity, matching the terse style of the surrounding sibling-suffix patterns.
  • Since the PR explicitly only closes the generated-classification gap for feat(miner): add a late-binding freshness check against live repo state before open_pr fires #3007 and not the late-binding freshness-check slice, it may be worth a one-line note in the PR body reiterating that a follow-up PR is expected, to help reviewers track the issue's remaining scope.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ Linked #3007
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 ✅ 25/25 PR body includes validation/test evidence.
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
  • Keep the PR focused and include validation evidence before maintainer review.
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.

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): add a late-binding freshness check against live repo state before open_pr fires

1 participant