feat: enrich INHERITS edges from SCIP's compiler-verified relationships#23
Open
pradeepmouli wants to merge 3 commits into
Open
feat: enrich INHERITS edges from SCIP's compiler-verified relationships#23pradeepmouli wants to merge 3 commits into
pradeepmouli wants to merge 3 commits into
Conversation
import_scip_index defined an ImportStats.relations_added counter that was displayed in CLI output but never actually incremented -- SCIP's Relationship.is_implementation field (compiler/language-server-verified "Dog implements/extends Animal" data) was parsed into the index but discarded. Map is_implementation relationships onto RelationKind::Inherits, the same relation kind tree-sitter's @inherit.child/@inherit.parent captures already produce. SCIP has no separate flag for "extends" vs "implements" (confirmed against the scip crate's own doc comment, which uses exactly the Dog-implements-Animal example for is_implementation), and no language's relations.scm distinguishes them either, so this keeps both sources consistent. Resolution reuses the same scip_sym_to_file_name + file_name_to_ids two-step lookup and Parquet-COPY-with-UNWIND-fallback bulk write already used for CALLS edges. Verified end-to-end against a real scip-typescript index of lspeasy (the only available real indexer that emits is_implementation -- rust-analyzer's scip output has zero Relationship entries of any kind): INHERITS edges went from 38 to 249, with correct edges like WebSocketTransport.onError -> Transport.onError. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TAXDJyFdnA4BV1U2fxufdC
pradeepmouli
requested review from
johnintuit,
murari316 and
sandeep-mewara
as code owners
July 19, 2026 17:50
Collaborator
|
@pradeepmouli we've got few features lineup, would you be interested to work on them? after fixing all these bugs that you're raising PRs for? |
Contributor
Author
I would love to |
Unrelated to this PR's SCIP INHERITS-enrichment change, but the pre-commit hook's fmt/clippy checks block all commits until fixed. - scip/mod.rs: cargo fmt drift - lsp-to-scip/main.rs, vuln/mod.rs: allow question_mark / useless_borrows_in_formatting lints that newly apply because the 'stable' toolchain drifted since this code was written in May, not because the code changed (CI's dtolnay/rust-toolchain@stable also resolves to rustc 1.97.x).
Rewrites the two spots suppressed in the prior commit instead of disabling the lints: - lsp-to-scip/main.rs: replace if-let/else-if-let/else with ? operator - vuln/mod.rs: remove redundant & in format! arg
Contributor
Author
How'd you like to proceed? |
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.
Summary
import_scip_indexdefines anImportStats.relations_addedcounter that's displayed in CLI output but was never actually incremented — SCIP'sRelationship.is_implementationfield (compiler/language-server-verified "Dog implements/extends Animal" data) was parsed into the index but discarded.This maps
is_implementationrelationships ontoRelationKind::Inherits, the same relation kind tree-sitter's@inherit.child/@inherit.parentcaptures already produce. SCIP has no separate flag for "extends" vs "implements" (thescipcrate's own doc comment foris_implementationuses exactly theDog implements Animalexample), and no language'srelations.scmdistinguishes them either, so this keeps both sources consistent without touching any of the ~13 existingInherits-consuming call sites (pattern detection, type-hierarchy traversal, viz, export, multi-repo graph combination).Resolution reuses the existing
scip_sym_to_file_name+file_name_to_idstwo-step lookup and the Parquet-COPY-with-UNWIND-fallback bulk write already used forCALLSedges.Verification
Verified end-to-end against a real
scip-typescriptindex of a TypeScript monorepo (the only readily available real indexer that emitsis_implementation—rust-analyzer's SCIP output has zeroRelationshipentries of any kind, so it can't exercise this path):INHERITSedge count went from 38 to 249, with correct edges surfacing real interface implementations (e.g.WebSocketTransport.onError -> Transport.onError).Test plan
cargo test -p infigraph-core --lib scip::— 2 new unit tests (is_implementation_relationship_creates_inherits_edge,non_implementation_relationship_does_not_create_inherits_edge) covering both the positive case and that non-is_implementationrelationships (e.g.is_reference) are correctly ignoredcargo build -p infigraph-corescip-typescript-generated index (see above)🤖 Generated with Claude Code
https://claude.ai/code/session_01TAXDJyFdnA4BV1U2fxufdC