feat(enrichment): add caller-impact analyzer for removed exports with live callers - #3656
Conversation
… live callers A no-checkout headless reviewer sees only the diff, so it cannot tell that a PR removes (or renames away) an exported symbol that other, unchanged files in the same repo still import - a hidden cross-file compile/runtime break. This REES analyzer fills that gap. It parses exported top-level declarations dropped on removed (-) diff lines of changed non-entrypoint source files, resolves the symbol's callers on the default branch via repo-scoped GitHub Code Search, keeps only files the PR did not touch, and confirms each candidate genuinely imports the symbol from an internal module path (never a comment, a property access, or a same-named import from a third-party package) by fetching it at headSha. A symbol re-added anywhere in the PR is never flagged. Distinct from the two shipped export analyzers by design: api-break (JSONbored#1510) handles removed exports from public entrypoint barrels (downstream break, no network); unused-export (JSONbored#2025) handles added exports that are dead-on-arrival. This is the inverse of the latter - a removed export that still has callers - and owns the non-entrypoint internal files api-break leaves out. Fail-closed: a finding requires positive, verified evidence of a surviving caller. A missing token/headSha, invalid slug, failed/rate-limited/incomplete Code Search, malformed response, unreadable candidate file, or aborted signal all degrade to no finding rather than a fabricated one - an error in the search or fetch is never surfaced as a caller. Wires the CallerImpactFinding type, the brief.ts registry descriptor, and a public-safe render block; adds the canonical analyzer name and regenerates the analyzer metadata. Bounded symbol/search/file-fetch/caller caps. 23 node:test units cover every branch, including explicit fetch-error / no-token / malformed / incomplete / abort resolving to an empty result. Closes JSONbored#1509
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-06 00:07:54 UTC
⏸️ Suggested Action - Manual Review Review summary Nits — 5 non-blocking
Review context
Contributor next steps
Signal definitions
🟩 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.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3656 +/- ##
=======================================
Coverage ? 93.28%
=======================================
Files ? 314
Lines ? 32054
Branches ? 11747
=======================================
Hits ? 29903
Misses ? 1517
Partials ? 634
🚀 New features to boost your workflow:
|
Summary
Adds the caller-impact analyzer to the review-enrichment service (REES), resolving #1509. A no-checkout headless reviewer sees only the diff, so it is blind to the cross-file hazard where a PR removes (or renames away) an exported symbol that other, unchanged files in the repo still import — a hidden compile/runtime break. This analyzer surfaces exactly that, and only that.
How it works, entirely within
review-enrichment/:-) diff lines of changed non-entrypoint TS/JS source files.headShaand matching a real named / default / namespace import from an internal module path — never a bare-text hit in a comment, a property access, or a same-named import from a third-party package.Reports the removed symbol, its old-file line, and the unchanged caller file paths only — never source.
Distinct value (no overlap with shipped analyzers)
Fail-closed error handling
A finding requires positive, verified evidence of a surviving caller. Every error path degrades to no finding, never a fabricated one:
headSha/ invalid repo slug →[][]incomplete_results/ malformed Code Search response → that symbol yields no finding (an explicit unknown state, distinguished from a successful "no callers")[]An error in the search or the file fetch is never surfaced as a caller.
Scope
type(scope): short summaryConventional Commit format..env.example/metadata files are regenerated.CONTRIBUTING.md; does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
npm run typecheck— exit 0npm run rees:test— build + sourcemap validation +metadata:check(zero drift) +node:test: 1181 pass, 0 fail (23 new caller-impact units)npm run ui:typecheck— exit 0npm run ui:lint— 0 errorsnpm run ui:test— 64 passnpm run test:coverage— 490 files pass, 0 fail; the one touched main-repo file (src/review/enrichment-analyzer-names.ts) is 100% (LF 2 / LH 2, no branches). The analyzer itself lives inreview-enrichment/, which Codecov ignores.git diff --check— cleanSafety
safeCodeSpanhelper.review-enrichment/.Notes
github-code-search-callersendpoint category (own circuit-breaker budget).main; no base conflict.