forked from kent/consciousness
split capnp_store.rs into src/store/ module hierarchy
capnp_store.rs (1772 lines) → four focused modules: store/types.rs — types, macros, constants, path helpers store/parse.rs — markdown parsing (MemoryUnit, parse_units) store/view.rs — StoreView trait, MmapView, AnyView store/mod.rs — Store impl methods, re-exports new_node/new_relation become free functions in types.rs. All callers updated: capnp_store:: → store::
This commit is contained in:
parent
e34c0ccf4c
commit
635da6d3e2
11 changed files with 980 additions and 978 deletions
21
src/neuro.rs
21
src/neuro.rs
|
|
@ -4,13 +4,12 @@
|
|||
// interference detection, emotional gating, consolidation priority
|
||||
// scoring, and the agent consolidation harness.
|
||||
|
||||
use crate::capnp_store::Store;
|
||||
use crate::store::{Store, new_relation, now_epoch};
|
||||
use crate::graph::{self, Graph};
|
||||
use crate::similarity;
|
||||
use crate::spectral::{self, SpectralEmbedding, SpectralPosition};
|
||||
|
||||
use std::collections::HashMap;
|
||||
use crate::capnp_store::now_epoch;
|
||||
|
||||
const SECS_PER_DAY: f64 = 86400.0;
|
||||
|
||||
|
|
@ -524,7 +523,7 @@ pub fn agent_prompt(store: &Store, agent: &str, count: usize) -> Result<String,
|
|||
let mut items = replay_queue_with_graph(store, count * 2, &graph, emb.as_ref());
|
||||
items.retain(|item| {
|
||||
store.nodes.get(&item.key)
|
||||
.map(|n| matches!(n.node_type, crate::capnp_store::NodeType::EpisodicSession))
|
||||
.map(|n| matches!(n.node_type, crate::store::NodeType::EpisodicSession))
|
||||
.unwrap_or(false)
|
||||
|| item.key.contains("journal")
|
||||
|| item.key.contains("session")
|
||||
|
|
@ -776,8 +775,8 @@ pub fn daily_check(store: &Store) -> String {
|
|||
}
|
||||
|
||||
// Log this snapshot too
|
||||
let now = crate::capnp_store::now_epoch();
|
||||
let date = crate::capnp_store::format_datetime_space(now);
|
||||
let now = crate::store::now_epoch();
|
||||
let date = crate::store::format_datetime_space(now);
|
||||
graph::save_metrics_snapshot(&graph::MetricsSnapshot {
|
||||
timestamp: now, date,
|
||||
nodes: graph.nodes().len(),
|
||||
|
|
@ -963,9 +962,9 @@ pub fn apply_differentiation(
|
|||
}
|
||||
|
||||
// Create new section→neighbor relation
|
||||
let new_rel = Store::new_relation(
|
||||
let new_rel = new_relation(
|
||||
section_uuid, neighbor_uuid,
|
||||
crate::capnp_store::RelationType::Auto,
|
||||
crate::store::RelationType::Auto,
|
||||
0.5,
|
||||
&mv.to_section, &mv.neighbor_key,
|
||||
);
|
||||
|
|
@ -1067,9 +1066,9 @@ pub fn triangle_close(
|
|||
let uuid_a = match store.nodes.get(a) { Some(n) => n.uuid, None => continue };
|
||||
let uuid_b = match store.nodes.get(b) { Some(n) => n.uuid, None => continue };
|
||||
|
||||
let rel = Store::new_relation(
|
||||
let rel = new_relation(
|
||||
uuid_a, uuid_b,
|
||||
crate::capnp_store::RelationType::Auto,
|
||||
crate::store::RelationType::Auto,
|
||||
sim * 0.5, // scale by similarity
|
||||
a, b,
|
||||
);
|
||||
|
|
@ -1144,9 +1143,9 @@ pub fn link_orphans(
|
|||
None => continue,
|
||||
};
|
||||
|
||||
let rel = Store::new_relation(
|
||||
let rel = new_relation(
|
||||
orphan_uuid, target_uuid,
|
||||
crate::capnp_store::RelationType::Auto,
|
||||
crate::store::RelationType::Auto,
|
||||
sim * 0.5,
|
||||
orphan_key, target_key,
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue