Skip to content

fix(scripts): grade export class/enum in dead-exports check - #10154

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
RealDiligent:fix/scripts-dead-exports-class-enum-10047
Jul 31, 2026
Merged

fix(scripts): grade export class/enum in dead-exports check#10154
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
RealDiligent:fix/scripts-dead-exports-class-enum-10047

Conversation

@RealDiligent

Copy link
Copy Markdown
Contributor

Summary

  • Extend EXPORTED_RUNTIME_SYMBOL to match export class / �bstract class / enum / const enum.
  • Update the scope JSDoc; no ALLOWED_EXPORTS changes.
  • Unit coverage for orphan class/enum, abstract class, external reference, and const enum.

Closes #10047

Test plan

  • [x]
    pm run dead-exports:check exits 0
  • Injected-file assertions for Orphan class, Kind enum, Used cross-file, abstract class, const enum

@RealDiligent
RealDiligent requested a review from JSONbored as a code owner July 31, 2026 09:40
@loopover-orb

loopover-orb Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Tip

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-31 10:16:29 UTC

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

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This PR extends the EXPORTED_RUNTIME_SYMBOL regex to also match export class/abstract class/enum/const enum, closing a real gap where those symbol kinds were invisible to the dead-exports check. The regex change is correct: `(?:const\s+enum|const|function|class|enum)` properly orders const-enum before bare const in the alternation so `export const enum Kind` captures 'Kind' and not 'enum', and abstract class is handled via the separate `(?:abstract )?` group. Test coverage is thorough, covering orphan class/enum, abstract class, const enum, cross-file references, and negative cases for non-exported classes and type/interface exports, and all CI checks passed.

Nits — 3 non-blocking
  • The regex will also match `export class` or `export enum` appearing inside multi-line comments or string literals if they start at the beginning of a line, though this is a pre-existing textual-matching limitation acknowledged in the file's own header, not something this PR introduces.
  • scripts/check-dead-exports.ts:44 — the updated JSDoc could explicitly note that `default` exports (e.g. `export default class Foo`) are still out of scope, since the anchor pattern requires a named form immediately after the keyword.
  • Consider adding a test case for `export default class` to make explicit that default exports remain unmatched, since that's a common pattern the current regex silently skips.

Decision drivers

  • ✅ Code review — No blockers (1 reviewer)
  • ✅ Gate result — Passing (No configured blocker found.)
Context & advisory signals — never blocks the verdict
Signal Result Evidence
Linked issue ✅ Linked #10047
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ❌ 8/20 High 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: 244 registered-repo PR(s), 95 merged, 38 issue(s).
Contributor context ✅ Confirmed Gittensor contributor RealDiligent; Gittensor profile; 244 PR(s), 38 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: moderate
Linked issue satisfaction

Addressed
The regex is extended in place to cover export class, abstract class, enum, and const enum while keeping const/function matching, the JSDoc is updated to reflect the new in-scope kinds and preserved type/interface exclusion, and no ALLOWED_EXPORTS entries were added.

Review context
  • Author: RealDiligent
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: not available
  • Official Gittensor activity: 244 PR(s), 38 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Start here: Add a concise scope and risk note.
  • Then work through the remaining 2 steps in the Signals table above.
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.
🧪 Chat with LoopOver

Ask LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.

  • @loopover ask <question> answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat <question> answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @loopover mention with a real question is routed to the closest matching read-only command automatically — no exact syntax required.

Full command reference: https://loopover.ai/docs/loopover-commands

🧪 Experimental — new and may change.

🟩 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 LoopOver, a quiet PR intelligence layer for OSS maintainers.

  • Re-run LoopOver review

@superagent-security

Copy link
Copy Markdown
Contributor

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

Extend EXPORTED_RUNTIME_SYMBOL to match class, abstract class, enum, and
const enum so runtime type-like exports are graded like const/function.

Closes JSONbored#10047

Co-authored-by: Cursor <cursoragent@cursor.com>
@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 31, 2026
@codecov

codecov Bot commented Jul 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.05%. Comparing base (4ce09ed) to head (29ddf8f).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #10154   +/-   ##
=======================================
  Coverage   92.05%   92.05%           
=======================================
  Files         931      931           
  Lines      114046   114046           
  Branches    27543    27543           
=======================================
  Hits       104988   104988           
  Misses       7759     7759           
  Partials     1299     1299           
Flag Coverage Δ
backend 95.68% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

@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.

LoopOver approves — the gate is satisfied and CI is green.

@loopover-orb
loopover-orb Bot merged commit 76b3043 into JSONbored:main Jul 31, 2026
8 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.

scripts(checks): check-dead-exports never sees export class/export enum, so 12 exported runtime symbols are ungraded

2 participants