Skip to main content

ripr/
lib.rs

1#![forbid(unsafe_code)]
2//! `ripr` is a static RIPR mutation-exposure analyzer for Rust workspaces.
3//!
4//! It does not run mutants. It reads changed Rust code, creates mutation-shaped
5//! probes, and estimates whether tests appear to reach, infect, propagate, and
6//! reveal those changed behaviors through meaningful oracles.
7//!
8//! # Library entry points
9//!
10//! Most integrations should start with [`check_workspace`] to analyze a unified
11//! diff and obtain structured findings.
12//!
13//! # Typical integration flow
14//!
15//! 1. Build a [`CheckInput`] with repository root, target diff, and options.
16//! 2. Call [`check_workspace`] to produce a [`CheckOutput`] report.
17//! 3. For a specific probe id, call [`explain_finding`] to inspect evidence.
18//! 4. Use [`collect_context`] when you need neighboring source context for UX.
19//!
20//! - Use [`check_workspace`] for end-to-end analysis.
21//! - Use [`explain_finding`] to retrieve focused evidence for one probe.
22//! - Use [`collect_context`] to retrieve neighboring context around a probe.
23//!
24//! The CLI wraps these same APIs and renders the resulting model in human,
25//! JSON, and annotation formats.
26//!
27//! # Exposure language
28//!
29//! `ripr` reports static exposure estimates such as [`ExposureClass::Exposed`]
30//! and [`ExposureClass::WeaklyExposed`]. Findings can also remain unknown when
31//! static evidence is incomplete. These results are intended to guide targeted
32//! test intent, not to claim runtime mutation outcomes.
33//!
34//! # Quick start
35//!
36//! ```no_run
37//! use ripr::{CheckInput, check_workspace};
38//! use std::path::PathBuf;
39//!
40//! let report = check_workspace(CheckInput {
41//!     root: PathBuf::from("."),
42//!     ..CheckInput::default()
43//! })?;
44//!
45//! println!("findings: {}", report.findings.len());
46//! # Ok::<(), String>(())
47//! ```
48//!
49
50/// Static analysis pipeline: diff loading, syntax indexing, probe generation,
51/// and finding classification.
52pub mod analysis;
53/// Public application orchestration and library-level use cases.
54pub mod app;
55/// Command-line adapter layer for the `ripr` binary.
56pub mod cli;
57/// Core domain model for probes, RIPR evidence, and exposure classes.
58pub mod domain;
59/// Experimental language-server sidecar adapter.
60pub mod lsp;
61/// Output renderers for human-readable, JSON, and annotation formats.
62pub mod output;
63
64/// Analyze a workspace diff using the default RIPR static pipeline.
65pub use app::{CheckInput, CheckOutput, check_workspace, collect_context, explain_finding};
66/// Domain model types exposed as part of the stable public contract.
67pub use domain::{ExposureClass, Finding, Probe, ProbeFamily, RiprEvidence};