ryo-analysis 0.1.0

Code graph and discovery engine for the RYO project
Documentation
//! Cascade engine for propagating mutations through dependent code.
//!
//! This module provides a generalized system for tracking mutation impacts
//! and automatically generating necessary follow-up changes.
//!
//! # Overview
//!
//! When a mutation is applied (e.g., renaming a symbol, adding a field),
//! it can have cascading effects throughout the codebase. The cascade engine:
//!
//! 1. **Analyzes** the impact of a mutation
//! 2. **Plans** the necessary cascade changes
//! 3. **Executes** the changes in the correct order
//!
//! # Example
//!
//! ```rust,ignore
//! use ryo_analysis::cascade::{CascadeEngine, CascadeStrategy};
//!
//! // Create an engine
//! let engine = CascadeEngine::new(&graph, &registry)
//!     .with_strategy(CascadeStrategy::safe());
//!
//! // Create a mutation spec
//! let rename = RenameSpec::new(path, "NewName");
//!
//! // Analyze impacts
//! let analysis = engine.analyze(&rename);
//! println!("Affected files: {}", analysis.affected_file_count());
//!
//! // Generate a plan
//! let plan = engine.plan(&rename);
//!
//! // Dry run first
//! let dry_result = engine.execute(plan.clone(), true);
//!
//! // Then execute for real
//! let result = engine.execute(plan, false);
//! ```
//!
//! # Impact Levels
//!
//! Mutations are classified by their impact level:
//!
//! - **Local**: Changes only affect the same file
//! - **Reference**: Changes affect references from other files
//! - **Structural**: Changes affect type structure (fields, variants)
//! - **Semantic**: Changes affect type behavior (derives, visibility)
//!
//! # Strategies
//!
//! The cascade engine supports different strategies for handling various situations:
//!
//! - `CascadeStrategy::default()` - Balanced approach
//! - `CascadeStrategy::safe()` - Prioritize data protection
//! - `CascadeStrategy::aggressive()` - Prioritize automation
//! - `CascadeStrategy::interactive()` - Prompt for decisions

mod analyzer;
mod impact;
mod spec;
mod strategy;

// === Analyzer ===
pub use analyzer::CascadeAnalyzer;

// === Spec ===
pub use spec::{CascadeSpec, Visibility};

// === Impact ===
pub use impact::{ImpactLevel, ImpactSet};

// === Strategy ===
pub use strategy::CascadeStrategy;