Skip to content

Address review findings#98

Merged
lzehrung merged 7 commits into
mainfrom
address-review-findings
May 20, 2026
Merged

Address review findings#98
lzehrung merged 7 commits into
mainfrom
address-review-findings

Conversation

@lzehrung
Copy link
Copy Markdown
Owner

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR follows up on prior review findings by reducing duplicated logic and improving performance in the indexer/graph/impact pipelines (parsed-context reuse, import-resolution caching, edge/item deduplication), plus consolidating diff-hunk utilities.

Changes:

  • Reuse/caches expensive work: parsed file contexts for namespace-member reference scans, and resolved import targets within collectImportsForFile().
  • Consolidate duplicated logic: shared diff-hunk utilities (src/impact/hunks.ts), shared Kotlin import parsing, and shared member-chain resolution in detailed symbol graph.
  • Reduce duplication/noise in outputs: deduplicate file graph edges during index build and replace JSON.stringify-based streaming impact item dedupe with a cheaper structural key.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/indexer/navigation.ts Reuses a cached parsed context when collecting namespace-member references.
src/indexer/imports.ts Adds per-file import resolution caching and consolidates implicit import binding heuristics via a helper.
src/indexer/build-index.ts Centralizes graph edge key generation and deduplicates edges when merging per-file + manifest edges.
src/impact/suggestions.ts Moves changed-line extraction to shared hunk utilities.
src/impact/streaming.ts Replaces expensive JSON.stringify dedupe with a structural emission key.
src/impact/report.ts Moves newFileRangeForHunk into shared hunk utilities and re-exports it.
src/impact/report-suggestions.ts Uses shared hunk utilities and caps reference scans for “untested change” suggestions.
src/impact/map.ts Uses and re-exports shared changed-line collection helper.
src/impact/hunks.ts New shared module for diff-hunk line/range utilities.
src/impact/context.ts Uses graph adjacency helpers and attempts to preserve typeOnly metadata on edges.
src/impact/analyzer.ts Threads a bounded maxReferences limit into reference scanning with headroom.
src/graphs/symbol-graph-detailed.ts Deduplicates member-chain resolution logic into a shared helper.
src/graphs/specifiers.ts Reuses Kotlin import statement parser instead of local regex.
REVIEW_PLAN.md Documents review follow-ups and remaining refactor opportunities.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/indexer/build-index.ts Outdated
Comment on lines +479 to +480
const target = edge.to.type === "file" ? edge.to.path : edge.to.name;
return `${edge.from}::${target}::${edge.raw ?? ""}::${edge.typeOnly ? 1 : 0}`;
Comment thread src/impact/context.ts Outdated
const revDeps = reverseDeps.get(edge.to.path) || [];
revDeps.push(edge.from);
reverseDeps.set(edge.to.path, revDeps);
typeOnlyByEdge.set(`${edge.from}\0${edge.to.path}`, edge.typeOnly);
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.

Comment thread src/impact/streaming.ts Outdated
Comment on lines +156 to +172
function impactItemEmissionKey(item: ImpactItem, partial: boolean): string {
const symbols = item.symbols.slice().sort().join(",");
const reasons = item.reasons.slice().sort().join(",");
const refCount = item.refs?.length ?? 0;
const hintCount = item.explain?.hints?.length ?? 0;
return [
item.file,
partial ? "partial" : "final",
symbols,
reasons,
item.severity.toFixed(6),
String(item.depth ?? 0),
String(item.confidence ?? 0),
String(refCount),
String(hintCount),
].join("|");
}
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 16 out of 16 changed files in this pull request and generated no new comments.

@lzehrung lzehrung merged commit 263c4dc into main May 20, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants