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
//! Workspace-backed conversation thread/message storage.
//!
//! Conversations are stored as JSONL files under
//! `<workspace>/memory/conversations/` (rooted at
//! [`MemoryConfig::workspace`](crate::memory::config::MemoryConfig)). Thread
//! metadata is an append-only upsert/delete log in `threads.jsonl`; each
//! thread's messages live in a dedicated JSONL file under `threads/<id>.jsonl`
//! for straightforward inspection and recovery.
//!
//! This is **transcript persistence**, not semantic indexing: it owns the raw
//! thread/message records and a local trigram/CJK-bigram inverted index for
//! cross-thread substring search over those transcripts. The richer
//! summary-tree archival of transcripts lives in `super::archivist`.
//!
//! ## Layout
//!
//! - [`types`] — the on-disk wire types (threads, messages, patches, hits).
//! - [`tokenize`] — multilingual normalization + character n-gram tokenizer.
//! - [`inverted_index`] — in-memory trigram/bigram index over message content.
//! - [`store`] — the JSONL [`ConversationStore`] (append/read/update/delete,
//! process-wide write serialization, warm-index cache, cross-thread search).
//! - [`bus`] — a channel-persistence subscriber that mirrors inbound/processed
//! channel turns into the store.
//!
//! ## Ported-from-OpenHuman notes
//!
//! - The process-wide write mutex and per-workspace index cache are static
//! [`std::sync::LazyLock`]`<`[`parking_lot::Mutex`]`>` (OpenHuman used
//! `once_cell::sync::Lazy`, which is not a dependency here).
//! - The event bus is abstracted behind the [`ConversationEventBus`] /
//! [`ChannelEventHandler`] traits and a self-contained [`ChannelEvent`] type,
//! so this module carries no dependency on the host's channel/event-bus
//! layer (OpenHuman tied directly into `core::event_bus::DomainEvent`).
pub use ;
pub use ;
pub use ;