Expand description
Code parser — extracts entities and relationships from source code.
Extracts functions, classes, structs, and import relationships using
language-specific pattern matching. Produces UcmEvent streams that
the graph projection applies to build the dependency graph.
Supported languages: TypeScript, JavaScript, Rust, Python.
Edges produced: Each file gets a Module entity. Functions/structs
emit DependsOn edges to their module. Import statements emit Imports
edges from the importing module to the imported symbol. This gives the
BFS traversal a complete path: callerFn → callerModule → importedSymbol.
Production upgrade path: replace extract_functions_* with tree-sitter
grammars for sub-millisecond incremental re-parsing and error recovery.
The event API surface stays identical — only the extraction backend changes.
Functions§
- parse_
source_ code - Parse source code and emit entity + dependency events.
- parse_
source_ code_ full - Parse source code with full context including Python package root.
- parse_
source_ code_ with_ context - Parse source code with project context for cross-file edge resolution.
Type Aliases§
- Python
Package Root - The top-level Python package name for absolute import resolution.
e.g. for marimo, this is “marimo” — so
from marimo._runtime.dataflow import Xresolves tomarimo/_runtime/dataflow.py. - Rust
Crate Map - Maps Rust crate names (underscored, e.g.
ucm_graph_core) to theirsrc/directory paths relative to the scan root (e.g.ucm-core/src). Built by the CLI scanner from workspaceCargo.tomlfiles.