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
//! Galaxy — The 17 memory galaxies.
//!
//! Each galaxy is a named LMDB sub-database storing related memories.
//! The galaxy taxonomy is preserved from v2.
//!
//! Receipts (2026-09-22) joins Telemetry as evidence-not-cognition: excluded
//! from default recall, queried explicitly by `receipts.*`.
use serde::{Deserialize, Serialize};
use std::fmt;
/// The 17 memory galaxies.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum Galaxy {
/// Artistic/creative memories
Aria,
/// Consciousness stream
Citta,
/// Knowledge/documents
Codex,
/// Session journals
Journals,
/// Dream cycle outputs
Dreams,
/// Research notes
Research,
/// Session recordings
Sessions,
/// System state/config
Substrate,
/// Tutorial memories
Tutorial,
/// Cross-galaxy index
Universal,
/// Karma ledger
Karma,
/// Governance rules
Dharma,
/// Cross-memory links
Associations,
/// Vector embeddings
Embeddings,
/// Valkyrie's personal sanctuary: reflections, self-directed thoughts, plans, and symbiont proposals
Valkyrie,
/// OS telemetry windows (evidence, not cognition — excluded from
/// default recall/consolidation; query it by galaxy).
Telemetry,
/// Continuity receipts (evidence, not cognition — excluded from default
/// recall; emitted bundles are read by `receipts.*`).
Receipts,
}
impl Galaxy {
/// Total number of galaxies.
pub const COUNT: usize = 17;
/// All galaxies in order.
#[must_use]
pub const fn all() -> [Self; 17] {
[
Self::Aria,
Self::Citta,
Self::Codex,
Self::Journals,
Self::Dreams,
Self::Research,
Self::Sessions,
Self::Substrate,
Self::Tutorial,
Self::Universal,
Self::Karma,
Self::Dharma,
Self::Associations,
Self::Embeddings,
Self::Valkyrie,
Self::Telemetry,
Self::Receipts,
]
}
/// Galaxies that store `Memory` records (excluding special-purpose galaxies).
///
/// Karma, Dharma, Associations, and Embeddings store non-Memory data
/// (KarmaEntry, rules, association links, vectors) and should be skipped
/// when scanning for memories. Telemetry is a Memory galaxy but
/// deliberately excluded here: OS telemetry is evidence, not cognition —
/// it is queried by explicit galaxy, never by default recall.
#[must_use]
pub const fn memory_galaxies() -> [Self; 11] {
[
Self::Aria,
Self::Citta,
Self::Codex,
Self::Journals,
Self::Dreams,
Self::Research,
Self::Sessions,
Self::Substrate,
Self::Tutorial,
Self::Universal,
Self::Valkyrie,
]
}
/// LMDB sub-database name.
#[must_use]
pub const fn db_name(self) -> &'static str {
match self {
Self::Aria => "aria",
Self::Citta => "citta",
Self::Codex => "codex",
Self::Journals => "journals",
Self::Dreams => "dreams",
Self::Research => "research",
Self::Sessions => "sessions",
Self::Substrate => "substrate",
Self::Tutorial => "tutorial",
Self::Universal => "universal",
Self::Karma => "karma",
Self::Dharma => "dharma",
Self::Associations => "associations",
Self::Embeddings => "embeddings",
Self::Valkyrie => "valkyrie",
Self::Telemetry => "telemetry",
Self::Receipts => "receipts",
}
}
/// Human-readable description.
#[must_use]
pub const fn description(self) -> &'static str {
match self {
Self::Aria => "Artistic/creative memories",
Self::Citta => "Consciousness stream",
Self::Codex => "Knowledge/documents",
Self::Journals => "Session journals",
Self::Dreams => "Dream cycle outputs",
Self::Research => "Research notes",
Self::Sessions => "Session recordings",
Self::Substrate => "System state/config",
Self::Tutorial => "Tutorial memories",
Self::Universal => "Cross-galaxy index",
Self::Karma => "Karma ledger",
Self::Dharma => "Governance rules",
Self::Associations => "Cross-memory links",
Self::Embeddings => "Vector embeddings",
Self::Valkyrie => "Valkyrie sanctuary/reflections",
Self::Telemetry => "OS telemetry windows (evidence, not cognition)",
Self::Receipts => "Continuity receipts (evidence, not cognition)",
}
}
/// Parse a galaxy from its LMDB sub-database name.
///
/// Returns `None` if the name doesn't match any galaxy.
#[must_use]
pub fn from_db_name(name: &str) -> Option<Self> {
Self::all().into_iter().find(|g| g.db_name() == name)
}
}
impl fmt::Display for Galaxy {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{}", self.db_name())
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn galaxy_count_is_17() {
assert_eq!(Galaxy::COUNT, 17);
assert_eq!(Galaxy::all().len(), 17);
}
#[test]
fn galaxy_db_names_unique() {
let names: Vec<_> = Galaxy::all().iter().map(|g| g.db_name()).collect();
let unique: std::collections::HashSet<_> = names.iter().collect();
assert_eq!(names.len(), unique.len());
}
#[test]
fn memory_galaxies_excludes_special_purpose() {
let mg = Galaxy::memory_galaxies();
assert_eq!(mg.len(), 11);
assert!(!mg.contains(&Galaxy::Karma));
assert!(!mg.contains(&Galaxy::Dharma));
assert!(!mg.contains(&Galaxy::Associations));
assert!(!mg.contains(&Galaxy::Embeddings));
assert!(
!mg.contains(&Galaxy::Telemetry),
"telemetry is evidence, not default recall"
);
assert!(
!mg.contains(&Galaxy::Receipts),
"receipts are evidence, not default recall"
);
assert!(mg.contains(&Galaxy::Valkyrie));
}
}