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
//! TotalReclaw Core — Canonical crypto primitives and shared logic.
//!
//! This crate is the single source of truth for all TotalReclaw cryptographic
//! operations. It provides WASM and PyO3 bindings (feature-gated) so that
//! TypeScript, Python, and Rust consumers share byte-for-byte identical output.
//!
//! # Modules
//!
//! - [`crypto`] — Key derivation (BIP-39 + HKDF-SHA256), XChaCha20-Poly1305 encrypt/decrypt
//! - [`lsh`] — Locality-sensitive hashing (random hyperplane LSH)
//! - [`blind`] — Blind index generation (SHA-256 token hashing + Porter stemming)
//! - [`stemmer`] — Porter 1 stemmer (hand-rolled, NOT Snowball/Porter 2)
//! - [`fingerprint`] — Content fingerprint (HMAC-SHA256 with NFC normalization)
//! - [`protobuf`] — Minimal protobuf encoder for fact payloads
//! - [`reranker`] — BM25 + Cosine + RRF fusion reranker
//! - [`debrief`] — Session debrief response parser
//! - [`store`] — Store pipeline (pure computation: encrypt, index, encode)
//! - [`search`] — Search pipeline (pure computation: trapdoors, parse, decrypt+rerank; feature: `managed`)
//! - [`wallet`] — Ethereum wallet derivation (BIP-44 + Keccak256)
//! - [`userop`] — ERC-4337 v0.7 UserOp building + signing (feature: `managed`)
//! - [`hotcache`] — Generic in-memory hot cache for semantic query dedup (no WASM binding)
//! - [`consolidation`] — Store-time near-duplicate detection + supersede logic
//! - [`smart_import`] — Smart import profiling (prompt construction + response parsing)
/// Crate-level error type.
pub type Result<T> = Result;