Skip to main content

Crate trusty_contracts

Crate trusty_contracts 

Source
Expand description

Shared entity types for the trusty-* toolchain.

Why: the knowledge-graph layer (trusty-search-core::symbol_graph), the analysis sidecar (trusty-analyzer-core), and ingest pipelines (SCIP, NER, concept-cluster) all consume the same EntityType / EdgeKind / RawEntity shapes. Extracting them into a tree-sitter–free crate lets analyzer crates depend on the shapes without inheriting 16 language grammars.

What: pure data definitions — enums, structs, and the fact_hash_str helper. No async, no tokio, no tree-sitter. The tree-sitter–based extraction code (extract_entities, EntityExtractor, language-specific walkers) stays in trusty-search-core::entity.

Test: see #[cfg(test)] in this file — covers RawEntity::new id stability, EdgeKind::score_multiplier, and fact_hash_str determinism.

Modules§

tables
redb table name constants for entity storage.

Structs§

RawEntity
One extracted entity, anchored to a byte span and source line.

Enums§

EdgeKind
Edge kinds for the SymbolGraph knowledge graph.
EntityType
Taxonomy of program entities surfaced from source code.

Functions§

fact_hash_str
Short, stable hex hash of a string. Used by ingest sources (e.g. SCIP) to derive readable, collision-resistant entity IDs from opaque symbol strings.