Skip to content

Pipeline Architecture

The three-phase formal model for polyglot extraction, resolution, and graph construction.

3 min read

Pipeline Architecture

Omnideps processes software architectures through a formal three-phase pipeline based on language-independent Intermediate Representation (IR).


The 3-Phase Pipeline

  Source Files (Java, Rust, Python, C++, C)
                     │
                     ▼  [ Phase 1: Parallel AST Extraction (α) ]
            Concrete Syntax Trees (Tree-sitter)
                     │
                     ▼
             Scope Hierarchy & Entity Tree
                     │
                     ▼  [ Phase 2: Name & Type Resolution (β) ]
             Resolved Intermediate Representation (D_res)
                     │
                     ▼  [ Phase 3: Graph Synthesis (γ) ]
            Directed Multi-Graph G = ⟨V, E⟩
                     │
      ┌──────────────┴──────────────┐
      ▼                             ▼
Cytoscape.js Format           CSV Metrics & Raw IR

Phase 1: Parallel AST Extraction (α)

  1. Language Discovery: Scans target folders and resolves file extensions to SupportedLanguage.
  2. Rayon Concurrency: Distributes parsing tasks across CPU worker pools. Each file is parsed into a Concrete Syntax Tree (CST) using its official Tree-sitter grammar.
  3. Component Extraction:
    • Modules: Package hierarchies, namespaces, directories, and files.
    • Structured Types: Classes, structs, interfaces, traits, and enums.
    • Callables: Methods, free functions, constructors, and lambdas.
    • Variables & Fields: Member variables, function parameters, and return types.

Phase 2: Name & Scope Resolution (β)

Resolves syntactical query references into canonical fully-qualified names:

  1. Local Scope Lookup: Resolves identifiers within blocks and function bodies.
  2. Receiver Evaluation: Tracks this / self and instantiated receiver types.
  3. Cross-File Symbol Linking: Evaluates package namespaces, includes, and import hierarchies.
  4. Inheritance & Generics: Walks superclass and interface implementations, propagating type bindings for parameterized types (e.g. List<T>, Result<T, E>).

Phase 3: Graph Synthesis (γ: D_res → G)

Synthesizes a directed dependency multi-graph G = ⟨V, E⟩ containing canonical nodes and typed edges.

The 16 Formal Edge Kinds (DependencyEdgeKind)

Omnideps categorizes dependencies into 16 formal relationship types:

Edge KindCategoryDescription
IsAStructuralClass inheritance (extends).
ImplementsStructuralInterface or trait implementation (implements, impl Trait for Struct).
UsesFieldTypeStructuralField declaration typed as another component.
UsesLocalTypeStructuralLocal variable typed as another component.
UsesParamTypeStructuralMethod/function parameter typed as another component.
UsesReturnTypeStructuralFunction or method return type.
NestedInContainmentInner classes, structs, or nested types.
ModuleContainmentContainmentStructural placement of components within modules.
CallsBehavioralDirect function or method invocation.
InstantiatesBehavioralObject or struct creation (new Foo(), Foo { ... }).
AccessesFieldBehavioralDirect member field read or write.
ImportsDependencyExplicit module or symbol import.
CastsToBehavioralExplicit type conversion or cast.
AliasesStructuralType alias definition (type Foo = Bar).
AnnotatedWithMetadataApplied decorators or annotations (@Override, #[derive(...)]).
UsesTypeGeneralGeneral type references (e.g., generic type parameter bounds).