1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
//! # sdivi-core
//!
//! Pure-compute facade for the Structural Divergence Indexer (sdivi-rust).
//!
//! This crate is the stable, WASM-compatible public surface for embedding the
//! analysis pipeline in Rust programs, WASM bindings, and language bindings.
//! It has **no I/O, no clock, no tree-sitter, and no `std::fs`** — callers
//! supply pre-extracted data via the `*Input` struct family and receive
//! plain `serde` result types.
//!
//! Embedders that need the full FS-orchestrated pipeline (parsing, snapshot
//! writes, retention) should use `sdivi-pipeline` instead.
//!
//! # Quick start
//!
//! ```rust
//! use sdivi_core::ExitCode;
//!
//! assert_eq!(ExitCode::Success as i32, 0);
//! ```
//!
//! ## Pure-compute example
//!
//! ```rust
//! use sdivi_core::compute::coupling::compute_coupling_topology;
//! use sdivi_core::input::DependencyGraphInput;
//!
//! let g = DependencyGraphInput { nodes: vec![], edges: vec![] };
//! let result = compute_coupling_topology(&g).unwrap();
//! assert_eq!(result.node_count, 0);
//! ```
/// Pattern category contract — canonical category list and runtime discovery via [`list_categories`].
/// Errors produced by the sdivi-core pure-compute API.
/// Exit codes for the `sdivi` binary — public API, adding variants is a breaking change.
/// Input structs for the pure-compute API (WASM-safe serde types).
/// Pure-compute functions over [`input`] structs.
/// Re-exports of snapshot assembly, delta, trend, and boundary inference from `sdivi-snapshot`.
pub use ;
pub use AnalysisError;
pub use ExitCode;
// ── input type re-exports ──────────────────────────────────────────────────
pub use ;
// ── compute function re-exports ────────────────────────────────────────────
pub use ;
pub use compute_change_coupling;
pub use ;
pub use normalize_and_hash;
pub use ;
pub use ;
// ── facade re-exports (sdivi-snapshot) ──────────────────────────────────────
pub use ;
// ── snapshot types re-exported directly ───────────────────────────────────
pub use ;
pub use ;
pub use DivergenceSummary;
pub use ;
pub use TrendResult;
// ── fingerprint key re-export ──────────────────────────────────────────────
/// The fixed `blake3` key used for all pattern fingerprints.
///
/// Foreign extractors that produce pattern fingerprints must use this same key
/// to ensure their fingerprints are byte-identical to those produced by the
/// native Rust pipeline.
///
/// See [`normalize_and_hash`] for the canonical tree-aware algorithm.
pub use FINGERPRINT_KEY;
// ── inner-crate type re-exports (for sdivi-wasm and other embedders) ─────────
/// Graph metrics summary — re-exported from `sdivi-graph` for WASM embedders.
pub use GraphMetrics;
/// Leiden community detection result — re-exported from `sdivi-detection` for WASM embedders.
pub use LeidenPartition;
/// Pattern fingerprint catalog — re-exported from `sdivi-patterns` for WASM embedders.
pub use ;
/// Pattern fingerprint type — re-exported from `sdivi-patterns` for WASM embedders.
pub use PatternFingerprint;
/// Input struct for [`classify_hint`] — re-exported from `sdivi-patterns` for WASM embedders.
///
/// Contains only the two fields that `classify_hint` inspects: `node_kind` and `text`.
/// Foreign extractors construct this directly; the native pipeline uses
/// `sdivi_parsing::feature_record::PatternHint` and M33 will wire the conversion.
///
/// # Examples
///
/// ```rust
/// use sdivi_core::PatternHintInput;
///
/// let hint = PatternHintInput {
/// node_kind: "call_expression".to_string(),
/// text: "console.log(\"x\")".to_string(),
/// };
/// assert_eq!(hint.node_kind, "call_expression");
/// ```
pub use PatternHintInput;
/// Callee-text-aware classification — re-exported from `sdivi-patterns::queries`.
///
/// Returns a `Vec` of category names (0 or 1 in v0) for a [`PatternHintInput`].
/// Provides higher precision than [`category_for_node_kind`] by inspecting
/// `hint.text` against per-language regex tables.
///
/// [`category_for_node_kind`]: sdivi_patterns::queries::category_for_node_kind
///
/// # Examples
///
/// ```rust
/// use sdivi_core::{classify_hint, PatternHintInput};
///
/// let hint = PatternHintInput {
/// node_kind: "call_expression".to_string(),
/// text: "console.log(\"x\")".to_string(),
/// };
/// assert_eq!(classify_hint(&hint, "typescript"), vec!["logging"]);
/// ```
pub use classify_hint;
/// Commonly-imported items from sdivi-core.