Skip to content

feat(enrichment): unused-export / dead-on-arrival detector analyzer #2025

Description

@JSONbored

New REES github-light analyzer that detects exports newly ADDED by the PR that are never referenced anywhere in the repo (dead-on-arrival), using GitHub Code Search. This is the narrow additive half of the broader caller-impact analyzer (#1509 covers changed/removed exports with live callers); scope this strictly to net-new exports with zero references to avoid overlap. Bounded search fanout, fail-safe.

Deliverables

  • Add UnusedExportFinding ({ file, line, symbol: string }) + unusedExport? key to review-enrichment/src/types.ts
  • Create review-enrichment/src/analyzers/unused-export.ts: parse added top-level export declarations from the diff, resolve references via GitHub Code Search (repo-scoped, injected fetch), flag only symbols with zero non-declaration references; strict maxSymbols + maxSearches caps
  • Register a descriptor (category 'quality', cost 'github-light', requires ['files','github-token','head-sha']) in review-enrichment/src/analyzers/registry.ts with inline render()
  • Add review-enrichment/test/unused-export.test.ts covering an unreferenced new export flagged, a referenced export not flagged, the search cap, and the token-absent skip

References

  • review-enrichment/src/analyzers/duplication-scan.ts (github git-tree/search analyzer with injected fetch + fetch caps)
  • review-enrichment/src/external-fetch.ts (shared bounded fetch)
  • gh issue 1509 (caller-impact/dead-symbol — this bounty is the net-new-export subset only, do not duplicate its removed/changed-caller half)

Part of #1499.


size: S · gittensor:feature

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:featureGittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.help wantedExtra attention is needed

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions