Skip to main content

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 normalize;
26pub mod queries;
27
28pub use catalog::{PatternCatalog, PatternLocation, PatternStats};
29pub use entropy::compute_entropy;
30pub use fingerprint::{fingerprint_node_kind, PatternFingerprint, FINGERPRINT_KEY};
31pub use normalize::{normalize_and_hash, NormalizeNode};
32
33#[cfg(feature = "pipeline-records")]
34pub use catalog::build_catalog;