From ccc856f4ba335fa7d262aaafb161af7f7796108c Mon Sep 17 00:00:00 2001 From: Shanu Date: Wed, 19 Aug 2026 00:25:28 +0530 Subject: [PATCH] =?UTF-8?q?Remove=20the=20OpenHuman=20framing=20from=20cor?= =?UTF-8?q?e=20(#18=20=C2=A7C4)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Deletes `default_openhuman_dir()` and its one caller, `MemoryClient::new_local()`. `new_local` is the constructor that produced openhuman#5570: it resolved `~/.openhuman/workspace` from the home directory and never consulted the host's workspace scoping, so on any scoped host the write landed in a store nothing else reads -- it failed by succeeding. openhuman#5575 removed the last caller; the reviewer there noted no lint on the host side can hold this line (a scanner needle for a dead function fails the liveness check), so the deletion has to happen here. `default_openhuman_dir` existed for `new_local` alone. With it gone, core no longer knows the host's directory layout at all: every construction path takes an explicit workspace directory. What deliberately stays: - `global::init_default()` -- `#[cfg(test)]`, and its doc already warns it must never run in production. - The `"openhuman"` provider slug in the embedder resolution ladder -- host config vocabulary, not directory framing; removing it breaks existing configs for no containment gain. - `OPENHUMAN_OLLAMA_BASE_URL` in `TestEmbeddingHost` -- `#[cfg(test)]`. - Test fixture prose mentioning OpenHuman. `dirs` stays a normal dependency: `engine/persona.rs` still resolves the home directory for persona files. cargo test -p tinymemory-core: 804 passed, 0 failed cargo clippy -p tinymemory-core --all-targets: clean cargo fmt --all -- --check: clean --- core/src/lib.rs | 16 ---------------- core/src/store/client.rs | 13 ------------- 2 files changed, 29 deletions(-) diff --git a/core/src/lib.rs b/core/src/lib.rs index 4455dd7..8649b55 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -79,22 +79,6 @@ pub use tinymemory_api::host::{ DEFAULT_MEMORY_SYNC_INTERVAL_SECS, }; -/// The default OpenHuman root directory, `~/.openhuman`. -/// -/// The host resolves this through `config::default_root_openhuman_dir`, which -/// this crate cannot see. Reproduced here rather than added to the config seam -/// because the two callers only need it as a last-resort fallback when no -/// workspace was supplied. -/// -/// # Errors -/// -/// Returns `Err` when the home directory cannot be determined. -pub fn default_openhuman_dir() -> Result { - dirs::home_dir() - .ok_or_else(|| "Could not find home directory".to_string()) - .map(|home| home.join(".openhuman")) -} - pub use ingestion::{ ExtractedEntity, ExtractedRelation, ExtractionMode, IngestionJob, IngestionQueue, IngestionState, IngestionStatusSnapshot, MemoryIngestionConfig, MemoryIngestionRequest, diff --git a/core/src/store/client.rs b/core/src/store/client.rs index 992946e..e480827 100644 --- a/core/src/store/client.rs +++ b/core/src/store/client.rs @@ -128,19 +128,6 @@ impl MemoryClient { } } - /// Create a new local memory client using the default `.openhuman` directory. - /// - /// # Errors - /// - /// Returns an error string if the home directory cannot be resolved or if - /// initialization fails. - pub fn new_local() -> Result { - let workspace_dir = crate::default_openhuman_dir() - .map_err(|e| e.to_string())? - .join("workspace"); - Self::from_workspace_dir(workspace_dir) - } - /// Create a new memory client from a specific workspace directory. /// /// # Arguments