This document catalogs every edge type in the knowing knowledge graph: what it represents, which extractors produce it, its provenance tier, and how it participates in blast radius traversal and context ranking.
| Edge Type | Meaning | Provenance | Confidence | Producers | Blast Radius | RWR Weight |
|---|---|---|---|---|---|---|
calls |
Function/method invocation | ast_inferred / lsp_resolved | 0.7 / 0.9 | All 12 extractors, enricher | Yes (traversed) | 1.0 |
imports |
Module/package import | ast_inferred | 0.7 | All 12 extractors | No | 0.5 |
implements |
Type satisfies an interface | ast_inferred / lsp_resolved | 0.7 / 0.9 | Go extractor, enricher | No | 0.8 |
handles_route |
HTTP handler bound to a route | ast_inferred | 0.7 | Go, TS, Python, Rust, Java, C# extractors | No | 0.7 |
references |
Non-call identifier usage | ast_inferred / lsp_resolved / scip_resolved | 0.7 / 0.9 / 0.95 | Go extractor, Proto extractor, SQL extractor, SCIP ingestor, enricher | No | 0.4 |
depends_on |
Resource/symbol dependency | ast_inferred | 0.7 | Terraform, SQL, CSS extractors | No | 0.5 |
deploys |
K8s Service routes to Deployment | ast_inferred | 0.7 | K8s YAML extractor | No | 0.5 |
exposes |
K8s Ingress exposes Service | ast_inferred | 0.7 | K8s YAML extractor | No | 0.5 |
configures |
ConfigMap/Secret provides config | ast_inferred | 0.7 | K8s YAML extractor | No | 0.5 |
publishes |
Producer publishes to a topic/queue | ast_inferred | 0.7 | Cloud extractor (Serverless, CFN) | No | 0.5 |
subscribes |
Consumer subscribes to a topic/queue | ast_inferred | 0.7 | Cloud extractor (Serverless, CFN) | No | 0.5 |
connects_to |
Service connects to another service/network | ast_inferred | 0.7 | Cloud extractor (Docker Compose) | No | 0.5 |
runtime_calls |
HTTP call observed in traces | otel_trace | 0.2 - 0.95 | Trace ingestor | No | 0.3 (default) |
runtime_rpc |
gRPC/RPC call observed in traces | otel_trace | 0.2 - 0.95 | Trace ingestor | No | 0.3 (default) |
runtime_produces |
Message published to a topic | otel_trace | 0.2 - 0.95 | Trace ingestor | No | 0.3 (default) |
runtime_consumes |
Message consumed from a topic | otel_trace | 0.2 - 0.95 | Trace ingestor | No | 0.3 (default) |
callsA function or method invokes another function or method.
pkg.HandleLogin -calls-> pkg.AuthService.Validate means
HandleLogin contains a call expression that resolves to AuthService.Validate.calls edges.
The enricher upgrades ast_inferred calls to lsp_resolved when gopls confirms the definition.ast_inferred (confidence 0.7) from tree-sitter extraction; lsp_resolved
(confidence 0.9) after enrichment confirms the target via GetDefinition.TransitiveCallers. The recursive
CTE in SQLiteStore.TransitiveCallers walks calls edges backwards up to 5 levels deep.
All blast radius computations (the blast_radius MCP tool, PR impact analysis, context
ranking) depend exclusively on calls edges.calls edges
receive the maximum transition probability, making call-graph neighbors the strongest
signal for context relevance.calls edge records the exact source location (file, line,
column) of the call expression. The enricher uses this position to query gopls for
definition resolution.importsA file imports a module or package.
cmd/server/main.go -imports-> github.com/example/pkg
means the file declares an import of that package.import statements and require() calls. For Rust: use declarations. For Java:
import declarations. For C#: using directives. For Python: import and
from ... import statements. For Protocol Buffers: import statements. For CSS:
@import rules. For Terraform, SQL, and K8s: module/dependency references.ast_inferred (confidence 0.7). Import resolution is syntactic; tree-sitter
can reliably parse import paths without type information.implementsA concrete type satisfies an interface contract.
pkg.SQLiteStore -implements-> types.GraphStore
means SQLiteStore has methods matching the GraphStore interface.goextractor) discovers implements edges
by checking whether concrete types in the same package satisfy declared interfaces. The
LSP enricher also discovers implements edges via GetImplementation queries for
interface symbols.ast_inferred (confidence 0.7) from the Go extractor’s method-set
comparison; lsp_resolved (confidence 0.9) when discovered by the enricher through gopls.calls edges. However,
implements edges are valuable for understanding which concrete types back an interface
when planning changes.calls, reflecting that implementation
relationships are structurally significant. A change to an interface method likely affects
all implementors.handles_routeAn HTTP handler function is bound to a specific route pattern.
GET /api/users -handles_route-> api.GetUsersHandler means that HTTP requests matching
GET /api/users are dispatched to GetUsersHandler.http.HandleFunc, mux.Handle, gorilla/chi patterns, gin, echoapp.get(), Fastify, Hono, NestJS decorators, Next.js App Router@app.get()/@router.post() decorator parsing, Django path()/re_path()web::resource, Axum Router::route, Rocket attribute macros@GetMapping, @PostMapping, @RequestMapping, JAX-RS @Path/@GET[HttpGet], [HttpPost], [Route] attributes, minimal API app.Map*ast_inferred (confidence 0.7). Route detection is pattern-based from
tree-sitter AST nodes.handles_route edges connect runtime
trace data (which resolves to route patterns) to static handler functions, bridging the
gap between runtime observations and the static call graph.referencesA non-call usage of an identifier (type annotations, variable reads, constant references).
cmd/main.go -references-> types.Hash
means the file uses the Hash type without calling it.goextractor) emits references edges for
identifier usages that are not call expressions. Call targets already receive calls edges,
so the extractor explicitly excludes call positions to avoid redundant edges. The Protocol
Buffers extractor (protoextractor) emits references edges from RPC methods to their
request/response message types and from message fields to referenced message types. The SCIP
ingestor (internal/indexer/scipingest/) emits references edges for all symbol references
found in imported SCIP index files. The LSP enricher also discovers references via
GetReferences queries for functions and methods.ast_inferred (confidence 0.7) from the Go extractor; scip_resolved
(confidence 0.95) from SCIP ingest; lsp_resolved (confidence 0.9) when discovered by the
enricher.depends_onA resource or symbol depends on another resource or symbol.
aws_instance.web -depends_on-> aws_vpc.main
means the web instance has an explicit dependency on the VPC.depends_on block references between resourcesvar(--name)) references to defining selectorsast_inferred (confidence 0.7).deploysA Kubernetes Service routes traffic to a Deployment (selector match).
Service/api -deploys-> Deployment/api means the service’s selector matches the deployment’s labels.ast_inferred (confidence 0.7).exposesA Kubernetes Ingress exposes a Service.
Ingress/api -exposes-> Service/api means the ingress routes external traffic to the service.ast_inferred (confidence 0.7).configuresA Kubernetes ConfigMap or Secret provides configuration to a Deployment.
ConfigMap/settings -configures-> Deployment/api means the deployment mounts or references that config.ast_inferred (confidence 0.7).publishesA function or service publishes messages to a topic or queue.
functions/processOrder -publishes-> topic/order-events means the function sends messages to that topic.ast_inferred (confidence 0.7).subscribesA function or service subscribes to (consumes from) a topic or queue.
functions/handleOrder -subscribes-> topic/order-events means the function is triggered by messages on that topic.ast_inferred (confidence 0.7).connects_toA service connects to another service or network resource.
service/api -connects_to-> service/redis means the api service declares a dependency on redis (via depends_on or network membership).depends_on links and shared network membership).ast_inferred (confidence 0.7).Runtime edges are produced by the trace ingestor (internal/trace/ingestor.go) from
OpenTelemetry spans and HTTP log entries. Their edge type is determined by the
edgeTypeFromAttributes function, which inspects span attributes.
runtime_callsAn HTTP call between services observed in production traces.
user-service -runtime_calls-> order-service:POST /api/orders.http.method attribute,
or as the default when no other protocol is detected.otel_trace with embedded trace IDs (up to 5).ComputeConfidence(observationCount, daysSinceLastObserved).
See the Provenance Tiers section below.TransitiveCallers (which only follows calls edges).
Runtime edges provide a separate signal used for recency scoring in context ranking.runtime_rpcA gRPC or RPC call between services observed in traces.
rpc.service attribute.otel_trace.runtime_producesA service publishes a message to a messaging topic.
messaging.system and
messaging.destination attributes (e.g., Kafka topic, RabbitMQ queue).otel_trace.runtime_consumesA service consumes messages from a messaging system.
messaging.system attribute
but no messaging.destination (consumer side).otel_trace.Provenance tracks how an edge was discovered and determines its confidence level.
| Provenance | Confidence | Source | Meaning |
|---|---|---|---|
ast_inferred |
0.7 | Tree-sitter extractors | Edge inferred from AST structure without type resolution. Cross-package calls resolved heuristically from import aliases. |
lsp_resolved |
0.9 | LSP enricher (gopls) | Edge confirmed by querying the language server’s GetDefinition at the call site. The original ast_inferred edge is deleted and replaced. |
scip_resolved |
0.95 | SCIP ingestor | Edge resolved from a SCIP index file. Near-full confidence; SCIP indexes are produced by compiler-grade tools with complete type information. |
ast_resolved |
1.0 | Python extractor | Edge resolved with full confidence. (Python extractor uses this provenance, though cross-module targets may still be dangling.) |
otel_trace |
0.2 - 0.95 | Trace ingestor | Edge observed in production runtime data. Confidence varies by observation count and recency. |
Runtime edge confidence is computed by ComputeConfidence(observationCount, daysSinceLastObserved):
ConfidenceFromCount:| Observation Count | Confidence |
|---|---|
| > 1000 | 0.95 |
| >= 100 | 0.85 |
| >= 10 | 0.70 |
| >= 1 | 0.50 |
| 0 | 0.20 |
Edges are created during indexing. Each extractor walks the tree-sitter AST and emits edges
with provenance ast_inferred and confidence 0.7. Edge identity is determined by the
EdgeHash, which is computed from (source_hash, target_hash, edge_type, provenance).
This means the same source-target pair can have multiple edges if the provenance differs
(e.g., both an ast_inferred and an otel_trace edge for the same call relationship).
After indexing, the enrichment pipeline (internal/enrichment/enricher.go) runs gopls to
upgrade edges:
ast_inferred edge with call-site position data, query
GetDefinition at (file, line, column). If gopls returns a location, delete the old
edge and insert a new one with provenance lsp_resolved and confidence 0.9. (Deletion
is necessary because provenance is part of the edge hash.)GetImplementation (producing implements edges) and GetReferences (producing
references edges) to find relationships that tree-sitter missed.Runtime edges decay over time based on how recently they were last observed:
The DecayBracket function in internal/trace/confidence.go categorizes edges into these
buckets for diagnostics.
Edges become eligible for garbage collection when their confidence reaches 0.0 (not observed
for over 90 days). The ShouldGarbageCollect function checks whether
time.Now() - lastObserved > gcThresholdDays * 86400. The RuntimeEdgeStats method on
the trace ingestor reports GCEligible counts for monitoring.
Static edges (ast_inferred, lsp_resolved) are replaced on each re-index of the
containing file rather than decayed. When a file is re-indexed, edges from the old snapshot
that are not present in the new extraction result are effectively removed by the snapshot
management system.