ryo-analysis 0.1.0

Code graph and discovery engine for the RYO project
Documentation
//! Lightweight graph-based compilation safety checks.
//!
//! This module provides fast pre-mutation validation using the existing
//! `CodeGraph` and `SymbolRegistry` infrastructure. It's not a full type checker,
//! but catches common mutation errors quickly.
//!
//! # Design Philosophy
//!
//! - **Speed over completeness**: 10-100x faster than `cargo check`
//! - **Leverage existing infrastructure**: Uses `CodeGraph` edges and `SymbolRegistry`
//! - **Fail fast**: Catch obvious errors before expensive compilation
//!
//! # Capabilities
//!
//! - Symbol existence checks
//! - Known trait implementation verification
//! - Derive possibility checks (field types implement required traits)
//! - Borrow conflict analysis (via `DataFlowGraphV2::borrow_analysis()`)
//!
//! # Limitations
//!
//! Cannot handle: generics resolution, type inference, complex lifetimes.
//! Use `cargo check` for final validation.
//!
//! # Usage
//!
//! ```rust,ignore
//! use ryo_analysis::{GraphChecker, CodeGraph, SymbolRegistry};
//!
//! let checker = GraphChecker::new(&graph, &typeflow, &registry);
//!
//! // Quick symbol existence check
//! if checker.check_symbol_exists("MyStruct") {
//!     // Symbol exists
//! }
//!
//! // Check if derive is possible
//! match checker.check_derive_possible("MyStruct", "Default") {
//!     CheckResult::Ok => { /* proceed with mutation */ }
//!     CheckResult::Error(errors) => { /* abort or cascade */ }
//!     _ => {}
//! }
//!
//! // Borrow conflict detection: use BorrowTrackerV2.conflicts() directly
//! let tracker = dataflow.borrow_tracker();
//! let conflicts = tracker.conflicts(var_id, BorrowKind::Mutable, 10);
//! ```

mod cascade;
mod checker;
mod result;
mod traits;

pub use cascade::{
    cascade_add_derive, CascadeMutation, CascadeResult, CascadeStatus, CascadeStrategy,
};
pub use checker::GraphChecker;
pub use result::{CheckError, CheckResult, CheckWarning};
pub use traits::LightCheck;