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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
//! lunaris — umbrella crate. Re-exports `lunaris_core` types, exposes the
//! `open(url)` URL-scheme dispatcher AND the higher-level `Lunaris` handle
//! that drives the Phase 2 ingest hot path.
//!
//! ## Two construction paths
//!
//! - [`open()`](crate::open::open) — returns `Arc<dyn StoragePort>` for
//! callers that just want raw storage access (Plan 5 conformance harness,
//! low-level tests).
//! - [`Lunaris::open`](crate::handle::Lunaris::open) — returns a high-level
//! handle wired with a default [`Embedder`] + [`HlcClock`] so callers can
//! call `lunaris.ingest(episode).await?` without manually plumbing the
//! Phase 2 pipeline. This is what Helios uses.
//!
//! ## Prelude
//!
//! For day-to-day use, glob-import the curated common surface:
//!
//! ```rust
//! use lunaris::prelude::*;
//! ```
//!
//! See [`prelude`] for the exact list — it intentionally stays small
//! (handle, scope, episode builder, retrieval DSL, the pluggable
//! trait + `Noop*` pairs, and the umbrella error type).
// RFC 0001 Wave 1D — EpisodeBuilder lives here (NOT in lunaris-core) so
// `into_episode` can be `pub(crate)`, enforcing that only ScopedLunaris::ingest
// can stamp a scope onto an episode.
// W2-L2 — bulk FT invalidation for Helios force-push recovery (UC-G3).
// Internal fan-out logic; public surface is `Lunaris::invalidate_range`.
pub
// Plan 05-05 OPS-08 — `lunaris::logging::init()` JSON-vs-pretty subscriber
// selector helper. Production triggers per CONTEXT.md D-26: `LUNARIS_ENV=production`
// OR `!std::io::stdout().is_terminal()`. Re-exported as `init_logging` below
// so embedded callers can `use lunaris::init_logging;` without reaching into
// the module path.
// Phase 12 Option-A relocation: `WorkingMemory` moved here from
// `lunaris-recipes` so `HeliosScratchpad` (also in this crate) can compose
// over it without a dependency cycle. `lunaris-recipes` re-exports the type
// so Phase 9/10/11 callers using `lunaris_recipes::WorkingMemory` compile
// unchanged. Phase 13 proper primitives-crate extraction subsumes this.
// GA-1 — opt-in cross-encoder rerank stage on the production recall root
// (`LUNARIS_RECALL_RERANK`, read once at handle construction).
// `memory-update-intelligence` — pure cross-episode reconciliation decision
// core (dedup NOOP / additive Append / cross-episode Supersede). Consumed by
// `structured_ingest` to converge memories without copying Mem0's
// LLM-mutate-on-write; bi-temporal MVCC stays the source of truth.
// Plan 08-00 — `Lunaris::snapshot()` monotonic LSN marker. Pre-req for Plan
// 08-01 codegen so the `snapshot` surface entry has a real inherent method
// to bind from PyO3 + napi-rs. The module only contains an `impl Lunaris`
// block + `#[cfg(test)] mod tests`, so no extra `pub use` is required.
// Phase 23 — agent-facing structured ingest. Reuses the same INGEST-04
// single-atomic_write invariant as `ingest` but skips the LLM extractor.
pub use ;
pub use ;
pub use recent_by_source;
pub use EpisodeBuilder;
pub use ;
pub use ;
pub use ;
pub use ;
// Phase 23 — agent-facing structured-ingest public surface.
pub use ;
// Phase 12 Option-A: `WorkingMemory` lives here now. `lunaris-recipes`
// re-exports this path so the established `lunaris_recipes::WorkingMemory`
// import stays stable.
pub use WorkingMemory;
// Plan 05-05 OPS-08 — re-export `lunaris::logging::init` as
// `lunaris::init_logging` for the canonical embedded-caller use site
// `lunaris::init_logging();`. The `lunaris-server` binary calls
// `lunaris::logging::init()` via the full path; both are equivalent.
pub use init as init_logging;
pub use *;
pub use open;
// `bootstrap_app_role` / `BootstrapReport` (the Postgres production-role
// bootstrap behind `lunaris-server bootstrap-db`) were removed in 0.7.0 with
// `lunaris-storage-postgres`. Moon has no role/RLS bootstrap step — see
// docs/operations/external-moon.md.
// Plan 05-04 — opinionated v0 recipes (helios-rfc §5.3 surface). v0 ships only
// CodingSessionMemory (renamed from HeliosScratchpad in v0.5) + its borrowed
// AsOfScratchpad time-travel view; the other 9 recipes (RECIPE-V1-01..11) ship in v1.
/// Deprecated alias for [`CodingSessionMemory`]. Remove in v0.7.
// allow(deprecated): re-exporting the deprecated alias is the whole point —
// without the allow, the defining crate trips its own deprecation lint and
// `clippy -D warnings` fails. Downstream importers still get the warning.
pub use HeliosScratchpad;
pub use ;
pub use ;
// Plan 04 — verifier + consolidator trait surface re-exports so callers
// `use lunaris::{Verifier, Consolidator, NoopVerifier, NoopConsolidator}`
// without reaching into the per-crate paths.
// T1d (260609-dvi): ActRConsolidator re-exported so lunaris-mcp needs no
// direct dep on lunaris-consolidate.
pub use ;
pub use ;
// Phase 13 — per-turn reflect supervisor re-exports. Callers
// `use lunaris::{ReflectSupervisor, NoopReflectSupervisor, LlmReflectSupervisor,
// ReflectInput, ReflectOutput, ReflectOpts}`
// without reaching into lunaris-verify directly.
pub use ;
// Cfg-gated verifier backends — mirror the extract backends gating pattern.
pub use ;
pub use ;
// Phase 2 retrieve DSL re-exports — callers `use lunaris::{Vector, Keyword, ...}`
// rather than reaching into `lunaris_retrieve::`.
//
// Plan 03-02 added `Graph` to the retrieve crate; the umbrella crate forwards
// it here so callers `use lunaris::{Graph, EntityId}` for the canonical
// blueprint §8 compose example.
//
// N5/B2 added the RAPTOR `Tree` operator; forwarded here so callers
// `use lunaris::{Tree, Vector}` and never reach into `lunaris_retrieve::`
// (the retrieval-DSL guide's standing contract).
pub use ;
// Reranker trait + helpers re-exported from lunaris-rerank so callers
// `use lunaris::{Reranker, NoopReranker}`. The concrete cross-encoder
// (`LlamaCppReranker`) lives in `lunaris-llamacpp` — operators who want
// to construct it directly import from that crate; callers who only need
// the trait + Noop seam stay on this re-export. v0.4 N-03 cutover.
pub use ;
// Plan 03-03: Extractor trait + helpers re-exported from lunaris-extract so
// callers `use lunaris::{Extractor, NoopExtractor, EntityId}` for the
// canonical compose example. Following the W-8 fix, we re-export ONLY the
// trait + ID newtype + Noop impl + Validator outputs at the umbrella level.
// Callers wanting extract DTOs directly use `lunaris_extract::{Entity,
// Relation, Fact}` — namespacing prevents collision with `lunaris_core`'s
// storage primitives that share those names.
pub use ;
// Cfg-gated extractor backends. A `cargo check --no-default-features`
// build pulls no http stack.
pub use ;
pub use ;
// Re-export the backend concrete type for callers who want to construct
// directly (bypassing URL routing — needed by the conformance harness in
// Phase 5). Since 0.7.0 there is exactly one.
pub use MoonStorage;
/// Glob-import the common surface: `use lunaris::prelude::*;`.
///
/// This is a *curated* set — the handful of symbols a typical caller needs to
/// open a store, build an episode, run a retrieval, and plug in (or stub out)
/// the optional pipeline stages. It is deliberately **not** a glob of every
/// re-export; reach into `lunaris::` directly for the long tail (pipeline
/// handles, backend opts, conformance helpers, env-var constants, …).