Skip to main content

Crate sdivi_patterns

Crate sdivi_patterns 

Source
Expand description

Pattern fingerprinting and catalog for sdivi-rust.

Implements Stage 4 of the five-stage analysis pipeline. Classifies pattern hints into the five built-in categories, fingerprints their structural shapes with blake3, and assembles a PatternCatalog with per-category entropy.

§Design constraints

This crate must NOT depend on sdivi-graph or sdivi-detection.

§Quick start

use sdivi_patterns::PatternCatalog;

let catalog = PatternCatalog::default();
assert!(catalog.entries.is_empty());

Re-exports§

pub use catalog::PatternCatalog;
pub use catalog::PatternLocation;
pub use catalog::PatternStats;
pub use entropy::compute_entropy;
pub use fingerprint::fingerprint_node_kind;
pub use fingerprint::PatternFingerprint;
pub use fingerprint::FINGERPRINT_KEY;
pub use hint_input::PatternHintInput;
pub use normalize::normalize_and_hash;
pub use normalize::NormalizeNode;
pub use catalog::build_catalog;

Modules§

catalog
PatternCatalog — per-category pattern fingerprint aggregation.
entropy
Per-category normalized Shannon entropy for pattern catalogs.
fingerprint
PatternFingerprint — keyed blake3 digest of a pattern’s structural shape.
hint_input
PatternHintInput — WASM-safe input struct for crate::queries::classify_hint.
normalize
Tree-aware canonical fingerprint algorithm.
queries
Per-category node-kind classification rules.