Documentation
¶
Index ¶
- func BuildEdges(symbols []core.SymbolRecord) []core.Edge
- func DetectConflicts(a, b core.IsolatedChangeRegion) core.ConflictResult
- type CodeGraph
- func (g *CodeGraph) ComputeICR(intent string) core.IsolatedChangeRegion
- func (g *CodeGraph) Deps(filePath string) []core.Edge
- func (g *CodeGraph) Impact(query string, maxDepth int) []core.SymbolRecord
- func (g *CodeGraph) Replace(symbols []core.SymbolRecord, filesIndexed int)
- func (g *CodeGraph) Search(query string, limit int) []core.SymbolRecord
- func (g *CodeGraph) SemanticSearch(query string, limit int) []embeddings.Scored
- func (g *CodeGraph) Snapshot() ([]core.SymbolRecord, []core.Edge)
- func (g *CodeGraph) Status() core.Status
- func (g *CodeGraph) TestsFor(query string) []core.SymbolRecord
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildEdges ¶
func BuildEdges(symbols []core.SymbolRecord) []core.Edge
BuildEdges constructs all 8 edge types from the symbol set.
Edge construction order (matches Implementation Plan §3.1):
- defines (file → symbol) confidence 1.0
- contains (parent → child) confidence 1.0
- imports (file → import:path) confidence 0.9
- extends (subtype → supertype) confidence 0.85
- implements (concrete → interface/trait) confidence 0.85
- uses-type (symbol → referenced type) confidence 0.5
- calls (caller → callee) confidence 0.85 same-file, 0.6 cross-file
- tests (test sym → tested sym) confidence 0.8
"calls" and "uses-type" are scoped to same-file + imported-file symbols per the non-negotiable accuracy rule in the plan.
func DetectConflicts ¶
func DetectConflicts(a, b core.IsolatedChangeRegion) core.ConflictResult
DetectConflicts checks whether two ICRs have overlapping exclusive symbols or files.
Types ¶
type CodeGraph ¶
type CodeGraph struct {
// contains filtered or unexported fields
}
func (*CodeGraph) ComputeICR ¶
func (g *CodeGraph) ComputeICR(intent string) core.IsolatedChangeRegion
ComputeICR computes an Isolated Change Region for the given intent string.
func (*CodeGraph) Deps ¶
Deps returns all edges that touch the given file path. Uses exact-prefix matching: edges from "file:<path>" or whose node ID begins with "<path>::" (symbol IDs in that file).
func (*CodeGraph) Impact ¶
func (g *CodeGraph) Impact(query string, maxDepth int) []core.SymbolRecord
Impact returns all symbols reachable from the seed (identified by query) by traversing inbound edges up to maxDepth. "Inbound" means: things that call, test, or contain the seed symbol — i.e., the blast radius if the seed changes.
func (*CodeGraph) Replace ¶
func (g *CodeGraph) Replace(symbols []core.SymbolRecord, filesIndexed int)
func (*CodeGraph) Search ¶
func (g *CodeGraph) Search(query string, limit int) []core.SymbolRecord
Search returns symbols whose name, qualified name, file path, or signature contains the query string (case-insensitive).
func (*CodeGraph) SemanticSearch ¶
func (g *CodeGraph) SemanticSearch(query string, limit int) []embeddings.Scored
SemanticSearch ranks symbols against a free-text intent using the configured embedding backend (Model2Vec by default; TF-IDF if GROVE_EMBEDDINGS=tfidf). Documents are constructed from (name + qualifiedName + signature + docstring + parent). The engine is built lazily and cached until the next Replace().
func (*CodeGraph) TestsFor ¶
func (g *CodeGraph) TestsFor(query string) []core.SymbolRecord
TestsFor returns all test symbols that cover the given query target. Resolution order:
- If the query matches an existing symbol name, follow inbound `tests` edges (and inbound `calls` one hop further) to gather covering tests.
- Fallback: substring search in test files (for free-text queries).