feat(graph): add type hierarchy analysis - #119
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Adds S1.06b1 of the CodeGraph parity roadmap: type relations and type hierarchy analysis over stored v2 CodeGraph facts. This is service-level only (
graphquery.Serviceand the authorizinggraphservice.Service). No REST, MCP, or browser surface changes; those belong to S1.07/S1.09.TypeRelations: recorded outgoingtype_of/returns, incoming type users and returners, referenced types, and recordedoverrides. Every original edge occurrence is kept.type_knowledge=unknownwhen the producer recorded no type facts.TypeHierarchy:extends/implementsancestors (depth 8) and breadth-first descendants (depth 6, 400 rows; the viewer shows 24/240 withtotal/shown/truncated). Cycles and duplicate edges are visited once. When a bound stops the walk,bounded,partial, boundaries andhidden_subtypessay so. Go implicit implementations keep their synthesized metadata. Name-matched derived overrides are alwayssignature_uncertainand are kept separate from recorded overrides.CountHierarchyChildren: counts distinct direct subtypes and implementers in one query scoped to repository, upload, commit and schema, so the counts stay true when the list is truncated. A subtype linked by both relations counts once, asextends.EntityNeighborsinternal limit raised from 101 to 401, so the 400-row walk can see one row past its limit.Evidence
The expected answers come from the pinned CodeGraph
b9ca4b7981116909900368cc1686a1074cd4d4c1:test/fixtures/codegraph/type-hierarchy-facts.json: complete real-producer capture (37 nodes, 53 edges, 3 files, 5 unresolved references) with its four source files. The integration test checks their hashes.Base/Servicehierarchy and theBase.greetderived override.Known differences from upstream
Both are documented in
docs/graph-analysis.md:localeCompare.extendsandimplementscounts asextends; upstream counts it by whichever edge it reads first.Compatibility and security
Verification
Remaining S1.06 work
B2 dead-code candidates, flows, routes, screens and steps, and coverage of all thirteen source languages. The full Stage 1 gate has not been run, and this PR does not claim it passes.
🤖 Generated with Claude Code