sdivi_patterns/lib.rs
1#![deny(missing_docs)]
2//! Pattern fingerprinting and catalog for sdivi-rust.
3//!
4//! Implements Stage 4 of the five-stage analysis pipeline. Classifies
5//! pattern hints into the five built-in categories, fingerprints their
6//! structural shapes with `blake3`, and assembles a [`PatternCatalog`] with
7//! per-category entropy.
8//!
9//! # Design constraints
10//!
11//! This crate must NOT depend on `sdivi-graph` or `sdivi-detection`.
12//!
13//! # Quick start
14//!
15//! ```rust
16//! use sdivi_patterns::PatternCatalog;
17//!
18//! let catalog = PatternCatalog::default();
19//! assert!(catalog.entries.is_empty());
20//! ```
21
22pub mod catalog;
23pub mod entropy;
24pub mod fingerprint;
25pub mod hint_input;
26pub mod normalize;
27pub mod queries;
28
29pub use catalog::{PatternCatalog, PatternLocation, PatternStats};
30pub use entropy::compute_entropy;
31pub use fingerprint::{fingerprint_node_kind, PatternFingerprint, FINGERPRINT_KEY};
32pub use hint_input::PatternHintInput;
33pub use normalize::{normalize_and_hash, NormalizeNode};
34
35#[cfg(feature = "pipeline-records")]
36pub use catalog::build_catalog;