ryo-analysis 0.1.0

Code graph and discovery engine for the RYO project
Documentation

ryo-analysis

crates.io docs.rs License: MIT OR Apache-2.0

Status: stable. Part of the ryo workspace — AST-centric Rust programming for AI agents.

Code graph and discovery engine. AST-first: symbols are identified by their AST hierarchy (SymbolPath); physical files are derived as a View layer. CodeGraphV2 provides fast relationship traversal (calls, type references, trait impls, container hierarchy).

Install

cargo add ryo-analysis

Optional features:

Feature Effect
workspace Pulls in ryo-metadata for workspace-wide resolution
schemars JSON Schema derive
testing Re-exports ryo-symbol's test-utils
literal-search Full-text literal search via tantivy

Quickstart

use ryo_analysis::{SymbolPath, SymbolRegistry, SymbolKind};

let path = SymbolPath::builder("tokio")
    .push("sync")
    .push("Mutex")
    .build()?;

let mut registry = SymbolRegistry::new();
let id = registry.register(path, SymbolKind::Struct)?;

// Fast O(1) lookup
let resolved = registry.resolve(id);

API Summary

Module Purpose
context::AnalysisContext Workspace-wide analysis state
discovery::* Symbol search and pattern discovery
query::CodeGraphV2 Call / type / trait / container graph
query::TypeFlowGraphV2 Type-level usage and dependency graph
query::SpecFlowGraphV2 @spec: directive graph
cascade::* Cascade analysis (change-impact)
pattern::* Pattern-driven symbol detection
literal::* Literal value search (with literal-search)
import_map_builder::* Import / use resolution

SymbolPath, SymbolId, SymbolKind, SymbolRegistry, CodeEdgeV2 and related types are re-exported at the crate root.

Status

API surface considered stable for the v0.1.0 release.

License

Licensed under either of Apache-2.0 or MIT at your option.