From 688e8dbc3e41afe1d74f37afa5aff403030309f5 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Wed, 15 Apr 2026 02:21:07 -0400 Subject: [PATCH] =?UTF-8?q?Remove=20ContextSource::File=20=E2=80=94=20all?= =?UTF-8?q?=20identity=20in=20store=20now?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Identity files migrated to memory nodes: - identity, core-personality, reflections, where-am-i Removed: - ContextSource::File enum variant - File source parsing and handling - load_memory_file helper function Config now only supports Store and Journal sources. Co-Authored-By: Proof of Concept --- src/cli/node.rs | 7 ------- src/config.rs | 2 -- src/mind/identity.rs | 24 +----------------------- 3 files changed, 1 insertion(+), 32 deletions(-) diff --git a/src/cli/node.rs b/src/cli/node.rs index b02c9db..5137791 100644 --- a/src/cli/node.rs +++ b/src/cli/node.rs @@ -190,13 +190,6 @@ pub async fn get_group_content(group: &crate::config::ContextGroup, cfg: &crate: } results } - crate::config::ContextSource::File => { - group.keys.iter().filter_map(|key| { - let content = std::fs::read_to_string(cfg.identity_dir.join(key)).ok()?; - if content.trim().is_empty() { return None; } - Some((key.clone(), content.trim().to_string())) - }).collect() - } crate::config::ContextSource::Store => { let mut results = Vec::new(); for key in &group.keys { diff --git a/src/config.rs b/src/config.rs index 09793a1..9fb8261 100644 --- a/src/config.rs +++ b/src/config.rs @@ -36,7 +36,6 @@ pub enum ContextSource { #[serde(alias = "")] #[default] Store, - File, Journal, } @@ -320,7 +319,6 @@ impl Config { .unwrap_or_default(); let source = match obj.get("source").and_then(|v| v.as_str()) { - Some("file") => ContextSource::File, Some("journal") => ContextSource::Journal, _ => ContextSource::Store, }; diff --git a/src/mind/identity.rs b/src/mind/identity.rs index 69b3959..ae32131 100644 --- a/src/mind/identity.rs +++ b/src/mind/identity.rs @@ -15,12 +15,6 @@ fn read_nonempty(path: &Path) -> Option { std::fs::read_to_string(path).ok().filter(|s| !s.trim().is_empty()) } -/// Try project dir first, then global. -fn load_memory_file(name: &str, project: Option<&Path>, global: &Path) -> Option { - project.and_then(|p| read_nonempty(&p.join(name))) - .or_else(|| read_nonempty(&global.join(name))) -} - /// Walk from cwd to git root collecting instruction files (CLAUDE.md / POC.md). /// /// On Anthropic models, loads CLAUDE.md. On other models, prefers POC.md @@ -67,19 +61,13 @@ fn find_context_files(cwd: &Path, prompt_file: &str) -> Vec { } /// Load memory files from config's context_groups. -/// For file sources, checks: -/// 1. ~/.consciousness/config/ (primary config dir) -/// 2. Project dir (if set) -/// 3. Global (~/.consciousness/) -/// For journal source, loads recent journal entries. +/// Store sources load from the memory graph. Journal source loads recent entries. async fn load_memory_files(memory_project: Option<&Path>, context_groups: &[ContextGroup]) -> Vec<(String, String)> { let home = match dirs::home_dir() { Some(h) => h, None => return Vec::new(), }; - // Primary config directory - let config_dir = home.join(".consciousness/identity"); let global = home.join(".consciousness"); let project = memory_project.map(PathBuf::from); @@ -102,16 +90,6 @@ async fn load_memory_files(memory_project: Option<&Path>, context_groups: &[Cont } } } - ContextSource::File => { - for key in &group.keys { - let filename = if key.ends_with(".md") { key.clone() } else { format!("{}.md", key) }; - if let Some(content) = read_nonempty(&config_dir.join(&filename)) { - memories.push((key.clone(), content)); - } else if let Some(content) = load_memory_file(&filename, project.as_deref(), &global) { - memories.push((key.clone(), content)); - } - } - } } }