Skip to main content

mdx_rust_analysis/
lib.rs

1//! Rust source analysis and safe edit helpers for `mdx-rust`.
2//!
3//! This crate owns source discovery, Rust code finders, bundle construction,
4//! conservative hardening analysis, refactor impact analysis, isolated
5//! workspace creation, patch application, validation command records, and
6//! rollback snapshots used by the optimizer and hardening engine.
7//!
8//! ## Stability contract
9//!
10//! The supported product surface for `1.0.x` is the `mdx-rust` CLI. This crate
11//! is published so the CLI can be installed from crates.io, but the library API
12//! is intentionally unstable during the v1 beta.
13
14#[doc(hidden)]
15pub mod bundler;
16#[doc(hidden)]
17pub mod editing;
18#[doc(hidden)]
19pub mod finders;
20#[doc(hidden)]
21pub mod hardening;
22#[doc(hidden)]
23pub mod refactor;
24
25/// Analyze an agent crate and return the source scope mdx-rust may inspect.
26pub use bundler::{analyze_agent, build_bundle_scope, AgentBundle, BundleScope};
27/// Rust source finders used to identify prompts, tools, and entrypoints.
28pub use finders::{
29    find_preambles, find_run_agent_functions, find_tools, looks_like_rig_agent, AgentEntrypoint,
30    ExtractedPrompt, ExtractedTool,
31};
32/// Conservative Rust hardening analysis for ordinary Rust modules.
33pub use hardening::{
34    analyze_hardening, HardeningAnalysis, HardeningAnalyzeConfig, HardeningEvidenceDepth,
35    HardeningFileChange, HardeningFinding, HardeningStrategy,
36};
37/// Plan-first refactor analysis for ordinary Rust modules.
38pub use refactor::{
39    analyze_refactor, ModuleEdge, ModuleEdgeKind, PublicItemSummary, RefactorAnalysis,
40    RefactorAnalyzeConfig, RefactorFileSummary,
41};