feat(impact): persist import edge details + 2-hop impact candidates#50
Merged
PatrickSys merged 1 commit intomasterfrom Feb 28, 2026
Merged
feat(impact): persist import edge details + 2-hop impact candidates#50PatrickSys merged 1 commit intomasterfrom
PatrickSys merged 1 commit intomasterfrom
Conversation
Owner
PatrickSys
commented
Feb 28, 2026
- Persist internal import edge details (line + importedSymbols) in relationships/intelligence artifacts.\n- Use these details to compute 2-hop impact candidates for decision-card preflight.\n- Add structured preflight.impact.details while keeping preflight.impact.files for backward compatibility.\n- Ignore .pnpm-store/ repo-wide.\n\nTest plan: CI pnpm test; local pnpm build.
Greptile SummaryExtended the codebase indexing system to persist import edge details (line numbers and imported symbols) and compute 2-hop impact candidates for better risk assessment in decision cards.
The changes maintain the framework-agnostic architecture and add no Confidence Score: 4/5
|
| Filename | Overview |
|---|---|
| src/core/indexer.ts | Added line number parameter to trackImport call, conditionally includes importDetails in output |
| src/tools/search-codebase.ts | Implemented 2-hop impact analysis with edge details - complex logic with minor performance optimization opportunity |
| src/utils/usage-tracker.ts | Extended InternalFileGraph to track and persist import edge details (line + symbols) with proper merging logic |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Parse Imports<br/>indexer.ts] -->|line, symbols| B[InternalFileGraph.trackImport<br/>usage-tracker.ts]
B -->|merge details| C[importDetails Map<br/>line + importedSymbols]
C -->|toJSON| D[Persist to Artifacts<br/>relationships.json]
D -->|load| E[search-codebase.ts<br/>getImportDetailsGraph]
E -->|2-hop analysis| F[computeImpactCandidates<br/>hop 1 + hop 2]
F -->|top 20 candidates| G[DecisionCard.impact<br/>files + details]
G -->|format| H[CLI Display<br/>file:line hop N]
style B fill:#e1f5ff
style F fill:#fff4e1
style G fill:#e8f5e9
Last reviewed commit: 5bd84a1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.