Skip to content

fix(signals): classify grpc-node JS/TS protobuf stubs as generated - #3549

Closed
jimcody1995 wants to merge 1 commit into
JSONbored:mainfrom
jimcody1995:fix/path-matchers-js-ts-grpc-protobuf
Closed

fix(signals): classify grpc-node JS/TS protobuf stubs as generated#3549
jimcody1995 wants to merge 1 commit into
JSONbored:mainfrom
jimcody1995:fix/path-matchers-js-ts-grpc-protobuf

Conversation

@jimcody1995

Copy link
Copy Markdown
Contributor

Summary

Extend isGeneratedFile to recognize grpc-node message/service stubs (*_pb.js, *_pb.ts, *_grpc_pb.js, *_grpc_pb.ts), matching the existing .pb.js / .pb.ts dot-form protoc coverage. Includes direct isGeneratedFile / classifyChangedFile assertions and hand-authored .js/.ts negative cases.

Fixes #561

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.

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 — signals-only change with no visible UI.

Notes

Incremental maintenance parity for the path-matcher slop signals from #561. Supports generated-file classification work tracked in #2279.

Made with Cursor

Recognize grpc-node *_pb.js/ts and *_grpc_pb.js/ts output in isGeneratedFile
alongside the existing .pb.js/.pb.ts dot-form protoc plugin coverage.

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

Copy link
Copy Markdown
Contributor

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

@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 93.10%. Comparing base (ee052e7) to head (eef3cbd).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3549   +/-   ##
=======================================
  Coverage   93.10%   93.10%           
=======================================
  Files         302      302           
  Lines       31504    31504           
  Branches    11504    11504           
=======================================
  Hits        29333    29333           
  Misses       1517     1517           
  Partials      654      654           
Files with missing lines Coverage Δ
src/signals/path-matchers.ts 88.46% <ø> (ø)
🚀 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 5, 2026
@loopover-orb

loopover-orb Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Warning

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

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-07-05 16:53:21 UTC

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

⏸️ Suggested Action - Manual Review

Review summary
This PR extends `isGeneratedFileFrom` in src/signals/path-matchers.ts with a single regex `/_pb\.(js|ts)$/` to classify grpc-node's underscore-form JS/TS protobuf stubs (`*_pb.js`, `*_grpc_pb.js`, `*_pb.ts`, `*_grpc_pb.ts`) as generated, mirroring the existing underscore-form handling already present for Ruby/PHP/Nim/Lua protobuf stubs. The single suffix regex correctly covers both the plain `_pb.js` message stubs and the `_grpc_pb.js` service stubs since the latter's filename also ends in `_pb.js`, which the added tests correctly verify along with negative cases (`src/app.js`, `src/app.ts`). The change is additive, doesn't conflict with the pre-existing dot-form `.pb.js`/`.pb.ts` regex above it, is narrowly scoped, and is tied to the referenced issue #561 that already governs this file's other language-stub entries.

Nits — 2 non-blocking
  • Consider whether grpc-tools/protoc-gen-ts also emits `.d.ts` declaration stubs alongside `_pb.js` (e.g. `service_pb.d.ts`), which would not match this `_pb\.(js|ts)$` pattern since it ends in `.d.ts` not `.ts` — worth confirming against real grpc-node output before deciding whether to add it.
  • If grpc-node's TypeScript codegen does produce `_pb.d.ts` files in practice, add a follow-up case for that suffix alongside this PR's coverage.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ Linked #561
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: 104 registered-repo PR(s), 72 merged, 0 issue(s).
Contributor context ✅ Confirmed Gittensor contributor jimcody1995; Gittensor profile; 104 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: 104 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 added the manual-review Gittensor contributor context label Jul 5, 2026

@JSONbored JSONbored left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Farming already closed issues, please focus on new/currently open issues.

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. manual-review Gittensor contributor context

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(signals): slop signal — generated/vendored/dependency/docs matchers

2 participants