The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
feat(memory): route the recall, reset and flush paths through the contract\n\nThe host half of tinymemory#90, migrating the last queue call sites and the\ntwo recency-recall handlers off `tinymemory_core`.\n\n`memory.recall_context` and `memory.recall_memories` now ask the guard for\n`recall_namespace_recent`. This is the migration the direct-engine-refs\nratchet warned about by name: `recall_namespace_scored("")` looks like the\ntwin and is not — it ranks against nothing rather than degrading to recency.\nThe engine wrapper `recall_namespace_context_data` only added a rendered\n`context_text` the handler never read. Compiling is itself the type-identity\nproof: the engine's `NamespaceMemoryHit` and the contract's resolve to the\nsame item, so the helpers keep their signatures.\n\n`reset_tree` and `flush_now` move their SQL to the driver\n(`Maintenance::reset_derived_index` / `flush_pending`). What stays in\n`reset_tree_rpc` is what is genuinely the host's: removing the rendered wiki\nsummaries under its own content root, which the driver has no business\nknowing exist. The host-side `wake_workers` goes too — the wake is part of\nthe driver's operation now.\n\nThe store-behaviour halves of the affected tests move where a real store\nexists, continuing the split this PR series established:\n\n- `flush_now_enqueues_once_and_reports_stale_buffers` staged buffers behind\n the handler; the dedupe-per-window behaviour is pinned upstream in\n `flushing_twice_in_a_window_schedules_the_work_once`. The unit test that\n remains asserts the host's mapping — both fields pass through, and the\n u64→u32 buffer count clamps rather than wraps.\n- the raw-coverage integration test drops its reset/flush calls with a\n pointer to the conformance tests; an integration test can bind no driver.\n\nThe agent-memory exclusion becomes ambient-first with the request's thread\nas fallback. The merge resolution had kept main's ambient-only value, which\norphaned this branch's test — and the test is right: a recall reaching the\nadapter outside a turn has no ambient value, and its thread hint names\nexactly the thread whose auto-saved trigger would echo back.\n\nBoth ratchets tightened rather than loosened: the guard bypass entry for\n`documents.rs` (`active_memory_client`) is deleted now that nothing bypasses,\nand the direct-refs allowlist drops `sync_events_bridge.rs`, which no longer\nreferences the engine.\n\nBlocked on a tinymemory release containing #90, exactly as the diagnostics\nhalf was on v1.3.0: the members exist in the vendored source but in no\npublished artifact, and against v1.3.0 they answer UnknownMethod — observed\nlive in the envelope test before pointing it at a locally built module.\n\n
Shanu26ccc8a2d905
diff --git a/docs/specs/memory-guard-allowlist.md b/docs/specs/memory-guard-allowlist.mdindex c3b67c8ed0..6d60df848b 100644--- a/docs/specs/memory-guard-allowlist.md+++ b/docs/specs/memory-guard-allowlist.md@@ -156,7 +156,6 @@ are recorded here so M4c starts from the real set.| Path | Reason || --- | --- |-| `memory/ops/documents.rs` — `doc_ingest` and retrieval envelope handlers | These still depend on engine-only ingestion and retrieval shapes. Namespace/document listing, deletion, context query, and context recall now use the shared Documents API. || `memory/ops/sync.rs` | `client.ingestion_state().snapshot()` — queue telemetry, absent from the contract. || `flows/ops.rs` | The production namespace clear uses `MemoryDocuments`; only the directly injected `MemoryClientRef` test seam remains raw. || `integrations/composio/schemas.rs` | Passes `&MemoryClientRef` into `user_scopes::save`. |diff --git a/src/openhuman/agent/tinyagents/host/agent_memory.rs b/src/openhuman/agent/tinyagents/host/agent_memory.rsindex 775d30c2d0..11cf5fcadd 100644--- a/src/openhuman/agent/tinyagents/host/agent_memory.rs+++ b/src/openhuman/agent/tinyagents/host/agent_memory.rs@@ -378,7 +378,15 @@ impl AgentMemory for OpenHumanAgentMemory {// `cross_session` scope the episodic and event tiers — so scoping// to a session and excluding it is not a contradiction, and a// thread hint still narrows *to* that session.- exclude_session_id: current_thread_id_ref.as_deref(),+ //+ // Ambient first, the request's thread as fallback — not either+ // alone. Inside a turn the task-local names the thread whose+ // trigger was auto-saved, and when both are set they agree. But a+ // recall reaching this adapter *outside* a turn (an RPC-driven+ // recall carrying a thread hint) has no ambient value, and its+ // hint names exactly the thread whose saved trigger would echo+ // back. Dropping the fallback reintroduces the echo on that path.+ exclude_session_id: current_thread_id_ref.as_deref().or(session),// Widening past the requested session is a wiring decision, never a// runtime hint.cross_session: self.cross_session,diff --git a/src/openhuman/memory/binding.rs b/src/openhuman/memory/binding.rsindex ceb736953c..260669ad28 100644--- a/src/openhuman/memory/binding.rs+++ b/src/openhuman/memory/binding.rs@@ -500,6 +500,10 @@ pub(crate) struct FixedDiagnostics {/// between them — nothing ready, nothing running, backfill unfinished —/// has to set the two independently.backfill: bool,+ /// What [`MemoryMaintenance::flush_pending`] answers, when a test sets it.+ flush: crate::openhuman::memory::api::provider::types::FlushOutcome,+ /// What [`MemoryMaintenance::reset_derived_index`] answers, likewise.+ reset: crate::openhuman::memory::api::provider::types::ResetOutcome,}#[cfg(test)]@@ -528,6 +532,8 @@ mod fixed_diagnostics_impl {queue,failure: None,backfill: false,+ flush: Default::default(),+ reset: Default::default(),retry_calls: std::sync::atomic::AtomicUsize::new(0),retry_requeues: 0,reembed_calls: std::sync::atomic::AtomicUsize::new(0),@@ -546,6 +552,24 @@ mod fixed_diagnostics_impl {self}+ /// Answer [`MemoryMaintenance::flush_pending`] with `outcome`.+ pub(crate) fn flushing(+ mut self,+ outcome: crate::openhuman::memory::api::provider::types::FlushOutcome,+ ) -> Self {+ self.flush = outcome;+ self+ }++ /// Answer [`MemoryMaintenance::reset_derived_index`] with `outcome`.+ pub(crate) fn resetting(+ mut self,+ outcome: crate::openhuman::memory::api::provider::types::ResetOutcome,+ ) -> Self {+ self.reset = outcome;+ self+ }+/// How many times [`MemoryMaintenance::retry_failed`] has been called.pub(crate) fn retry_calls(&self) -> usize {self.retry_calls.load(std::sync::atomic::Ordering::SeqCst)@@ -676,6 +700,20 @@ mod fixed_diagnostics_impl {async fn backfill_in_progress(&self) -> Result<bool, MemoryError> {Ok(self.backfill)}++ async fn flush_pending(+ &self,+ ) -> Result<crate::openhuman::memory::api::provider::types::FlushOutcome, MemoryError>+ {+ Ok(self.flush.clone())+ }++ async fn reset_derived_index(+ &self,+ ) -> Result<crate::openhuman::memory::api::provider::types::ResetOutcome, MemoryError>+ {+ Ok(self.reset.clone())+ }}#[async_trait]diff --git a/src/openhuman/memory/bypass_allowlist_tests.rs b/src/openhuman/memory/bypass_allowlist_tests.rsindex 047c54cc29..098f8cc921 100644--- a/src/openhuman/memory/bypass_allowlist_tests.rs+++ b/src/openhuman/memory/bypass_allowlist_tests.rs@@ -251,11 +251,6 @@ const ALLOWED: &[(&str, &str, &str)] = &["the guard's own documents decorator forwarding to the inner family",),// ── Handlers with no typed contract twin (see the allowlist doc, §D) ──- (- "src/openhuman/memory/ops/documents.rs",- "active_memory_client(",- "namespace/doc/context handlers answer untyped Value shapes with no contract twin",- ),("src/openhuman/memory/ops/guard.rs","binding::for_workspace(",diff --git a/src/openhuman/memory/direct_engine_refs_tests.rs b/src/openhuman/memory/direct_engine_refs_tests.rsindex eac7becafe..84566c84f6 100644--- a/src/openhuman/memory/direct_engine_refs_tests.rs+++ b/src/openhuman/memory/direct_engine_refs_tests.rs@@ -558,11 +558,6 @@ const ALLOWED: &[(&str, Verdict, &str)] = &[Verdict::NeedsWiderSeam,"engine internals (tinycortex::memory_config_from); tinycortex-shaped, so no engine-neutral family can express it",),- (- "src/openhuman/memory/sync_events_bridge.rs",- Verdict::NeedsWiderSeam,- "the re-embed queue (queue::ensure_reembed_backfill, sync_events) has no capability family",- ),("src/openhuman/memory/tools/flavour.rs",Verdict::NeedsWiderSeam,diff --git a/src/openhuman/memory/guard/families.rs b/src/openhuman/memory/guard/families.rsindex d8a3063507..122e7eaa1a 100644--- a/src/openhuman/memory/guard/families.rs+++ b/src/openhuman/memory/guard/families.rs@@ -1080,6 +1080,25 @@ impl MemoryRetrieval for GuardedRetrieval {.await}+ /// Namespace-scoped like its scored sibling, and admitted under the same+ /// capability: recency versus ranking is a retrieval mode, not a policy+ /// boundary.+ async fn recall_namespace_recent(+ &self,+ namespace: &str,+ limit: usize,+ ) -> Result<Vec<NamespaceMemoryHit>, MemoryError> {+ self.policy.admit_read(+ Capability::Retrieval,+ "retrieval.recall_namespace_recent",+ namespace,+ false,+ )?;+ self.family()?+ .recall_namespace_recent(namespace, limit)+ .await+ }+async fn search_entities(&self,query: &str,diff --git a/src/openhuman/memory/guard/test_support.rs b/src/openhuman/memory/guard/test_support.rsindex af8e41fb9a..30f143910b 100644--- a/src/openhuman/memory/guard/test_support.rs+++ b/src/openhuman/memory/guard/test_support.rs@@ -1012,6 +1012,15 @@ impl MemoryRetrieval for RecordingProvider {Ok(vec![])}+ async fn recall_namespace_recent(+ &self,+ _namespace: &str,+ _limit: usize,+ ) -> Result<Vec<NamespaceMemoryHit>, MemoryError> {+ self.record(Call::plain("retrieval.recall_namespace_recent"));+ Ok(vec![])+ }+async fn search_entities(&self,_query: &str,diff --git a/src/openhuman/memory/ops/documents.rs b/src/openhuman/memory/ops/documents.rsindex 57f6c37863..812a951e90 100644--- a/src/openhuman/memory/ops/documents.rs+++ b/src/openhuman/memory/ops/documents.rs@@ -20,10 +20,9 @@ use tinymemory_core::store::NamespaceRetrievalContext;use super::envelope::{envelope, error_envelope, memory_counts};use super::guard::active_memory_guard;use super::helpers::{- active_memory_client, build_retrieval_context, current_workspace_dir,- filter_hits_by_document_ids, format_llm_context_message, maybe_retrieval_context,- memory_kind_label, parse_memory_document_summaries, query_limit_for_request,- RawDeleteDocumentResult,+ build_retrieval_context, current_workspace_dir, filter_hits_by_document_ids,+ format_llm_context_message, maybe_retrieval_context, memory_kind_label,+ parse_memory_document_summaries, query_limit_for_request, RawDeleteDocumentResult,};use super::helpers::{default_category, default_priority, default_source_type};@@ -555,23 +554,32 @@ pub async fn memory_recall_context(request: RecallContextRequest,) -> Result<RpcOutcome<ApiEnvelope<RecallContextResponse>>, String> {let include_references = request.include_references.unwrap_or(true);+ // The recency path, through the contract. `recall_namespace_recent` exists+ // for exactly this pair of handlers — `recall_namespace_scored("")` is NOT+ // a substitute, it ranks against nothing (see the member's doc). The+ // engine wrapper this used to call (`recall_namespace_context_data`) only+ // added a rendered `context_text` this handler never read; it builds its+ // own from the hits.let result = async {- let client = active_memory_client().await?;- client- .recall_namespace_context_data(&request.namespace, request.resolved_limit())+ let guard = active_memory_guard().await?;+ guard+ .as_retrieval()+ .ok_or_else(|| "memory driver does not support the retrieval family".to_string())?+ .recall_namespace_recent(&request.namespace, request.resolved_limit() as usize).await+ .map_err(|e| format!("memory.recall_context: {e}"))}.await;match result {- Ok(context) => {- let retrieval_context = build_retrieval_context(&context.hits);+ Ok(hits) => {+ let retrieval_context = build_retrieval_context(&hits);let counts = memory_counts([("num_entities", retrieval_context.entities.len()),("num_relations", retrieval_context.relations.len()),("num_chunks", retrieval_context.chunks.len()),]);- let llm_context_message = format_llm_context_message(None, &context.hits);+ let llm_context_message = format_llm_context_message(None, &hits);Ok(envelope(RecallContextResponse {context: maybe_retrieval_context(include_references, retrieval_context),@@ -590,10 +598,13 @@ pub async fn memory_recall_memories(request: RecallMemoriesRequest,) -> Result<RpcOutcome<ApiEnvelope<RecallMemoriesResponse>>, String> {let result = async {- let client = active_memory_client().await?;- client- .recall_namespace_memories(&request.namespace, request.resolved_limit())+ let guard = active_memory_guard().await?;+ guard+ .as_retrieval()+ .ok_or_else(|| "memory driver does not support the retrieval family".to_string())?+ .recall_namespace_recent(&request.namespace, request.resolved_limit() as usize).await+ .map_err(|e| format!("memory.recall_memories: {e}"))}.await;diff --git a/src/openhuman/memory/preferences/tests.rs b/src/openhuman/memory/preferences/tests.rsindex 5e30596035..a7367799cd 100644--- a/src/openhuman/memory/preferences/tests.rs+++ b/src/openhuman/memory/preferences/tests.rs@@ -135,6 +135,16 @@ impl MemoryRetrieval for ScriptedRetrieval {.collect())}+ async fn recall_namespace_recent(+ &self,+ namespace: &str,+ limit: usize,+ ) -> Result<Vec<NamespaceMemoryHit>, MemoryError> {+ // The scripted hits, minus the ranking the scored path pretends to do.+ self.recall_namespace_scored(namespace, "", limit, None)+ .await+ }+// The family's other methods are irrelevant here — this stub exists to feed// `recall_namespace_scored` a scripted breakdown. They are unreachable, so// they say so rather than returning a plausible empty value that could makediff --git a/src/openhuman/memory/read_rpc/admin.rs b/src/openhuman/memory/read_rpc/admin.rsindex 868b3bfa18..a8d94cc713 100644--- a/src/openhuman/memory/read_rpc/admin.rs+++ b/src/openhuman/memory/read_rpc/admin.rs@@ -126,70 +126,28 @@ pub(crate) fn clear_composio_sync_state(db_path: &std::path::Path) -> Result<u64// ── reset_tree ───────────────────────────────────────────────────────────pub async fn reset_tree_rpc(config: &Config) -> Result<RpcOutcome<ResetTreeResponse>, String> {- use tinymemory_core::queue::store as jobs_store;- use tinymemory_core::queue::types::{ExtractChunkPayload, NewJob};-- let cfg = config.clone();- let (tree_rows_deleted, chunks_requeued, jobs_enqueued) =- tokio::task::spawn_blocking(move || -> Result<(u64, u64, u64)> {- const TREE_TABLES: &[&str] = &[- "mem_tree_summaries",- "mem_tree_buffers",- "mem_tree_jobs",- "mem_tree_entity_index",- "mem_tree_trees",- ];- let tree_rows_deleted: u64 = with_connection(&cfg, |conn| {- let tx = conn.unchecked_transaction()?;- let mut total: u64 = 0;- for table in TREE_TABLES {- let n = tx- .execute(&format!("DELETE FROM {table}"), [])- .with_context(|| format!("delete from {table}"))?;- total += n as u64;- }- tx.commit()?;- Ok(total)- })?;-- let (chunks_requeued, jobs_enqueued) =- with_connection(&cfg, |conn| -> anyhow::Result<(u64, u64)> {- let tx = conn.unchecked_transaction()?;- let chunks_requeued = tx.execute(- "UPDATE mem_tree_chunks SET lifecycle_status = 'pending_extraction'",- [],- )? as u64;- let chunk_ids: Vec<String> = {- let mut stmt = tx.prepare("SELECT id FROM mem_tree_chunks")?;- let rows = stmt- .query_map([], |r| r.get::<_, String>(0))?- .collect::<rusqlite::Result<Vec<_>>>()- .context("collect chunk ids")?;- rows- };- let mut jobs_enqueued: u64 = 0;- for id in &chunk_ids {- let payload = ExtractChunkPayload {- chunk_id: id.clone(),- };- let job = NewJob::extract_chunk(&payload)- .context("build extract_chunk NewJob")?;- if jobs_store::enqueue_tx(&tx, &job)- .context("enqueue extract_chunk")?- .is_some()- {- jobs_enqueued += 1;- }- }- tx.commit()?;- Ok((chunks_requeued, jobs_enqueued))- })?;-- Ok((tree_rows_deleted, chunks_requeued, jobs_enqueued))- })+ // The derived-index reset — the table deletes, the chunk requeue and the+ // re-extraction enqueue — is the driver's now (`Maintenance::+ // reset_derived_index`), where the tables live. What stays here is what is+ // genuinely the host's: the rendered wiki summaries below are files this+ // host wrote under its own content root, and the driver has no business+ // knowing they exist.+ let binding = crate::openhuman::memory::binding::for_config(config)?;+ let Some(maintenance) = binding.provider().as_maintenance() else {+ return Err(format!(+ "reset_tree: driver '{}' does not serve Maintenance",+ binding.driver_id()+ ));+ };+ let outcome = maintenance+ .reset_derived_index().await- .map_err(|e| format!("reset_tree join error: {e}"))?- .map_err(|e| format!("reset_tree: {e:#}"))?;+ .map_err(|e| format!("reset_tree: {e}"))?;+ let (tree_rows_deleted, chunks_requeued, jobs_enqueued) = (+ outcome.rows_deleted,+ outcome.chunks_requeued,+ outcome.jobs_enqueued,+ );let summaries_dir = config.memory_tree_content_root()@@ -223,8 +181,6 @@ pub async fn reset_tree_rpc(config: &Config) -> Result<RpcOutcome<ResetTreeRespo}}- tinymemory_core::queue::wake_workers();-let resp = ResetTreeResponse {tree_rows_deleted,chunks_requeued,@@ -315,35 +271,26 @@ pub async fn flush_source_tree_rpc(// ── flush_now ─────────────────────────────────────────────────────────────pub async fn flush_now_rpc(config: &Config) -> Result<RpcOutcome<FlushNowResponse>, String> {- use crate::openhuman::memory::tree::tree::store as tree_store;- use tinymemory_core::queue::store as jobs_store;- use tinymemory_core::queue::types::{FlushStalePayload, NewJob};-- let cfg = config.clone();- let resp = tokio::task::spawn_blocking(move || -> Result<FlushNowResponse> {- let stale = tree_store::list_stale_buffers(&cfg, chrono::Utc::now())- .context("list stale buffers")?;- let stale_buffers = stale.len() as u32;-- let payload = FlushStalePayload {- max_age_secs: Some(0),- };- let now = chrono::Utc::now();- let date_iso = now.format("%Y-%m-%d").to_string();- let hour_block = chrono::Timelike::hour(&now) / 3;- let job = NewJob::flush_stale(&payload, &date_iso, hour_block)- .context("build flush_stale NewJob")?;- let enqueued = jobs_store::enqueue(&cfg, &job)- .context("enqueue flush_stale job")?- .is_some();- Ok(FlushNowResponse {- enqueued,- stale_buffers,- })- })- .await- .map_err(|e| format!("flush_now join error: {e}"))?- .map_err(|e| format!("flush_now: {e:#}"))?;+ // Asked of the driver (`Maintenance::flush_pending`): the buffer walk, the+ // window-keyed dedupe and the enqueue were engine mechanics the host was+ // re-implementing. No `spawn_blocking` — the driver owns whether its own+ // reads block. The wire shape is unchanged: `enqueued: false` still means+ // "already scheduled this window" when `stale_buffers` is non-zero.+ let binding = crate::openhuman::memory::binding::for_config(config)?;+ let Some(maintenance) = binding.provider().as_maintenance() else {+ return Err(format!(+ "flush_now: driver '{}' does not serve Maintenance",+ binding.driver_id()+ ));+ };+ let outcome = maintenance+ .flush_pending()+ .await+ .map_err(|e| format!("flush_now: {e}"))?;+ let resp = FlushNowResponse {+ enqueued: outcome.enqueued,+ stale_buffers: u32::try_from(outcome.stale_buffers).unwrap_or(u32::MAX),+ };let log = format!("memory_tree::read: flush_now enqueued={} stale_buffers={}",diff --git a/src/openhuman/memory/read_rpc_tests.rs b/src/openhuman/memory/read_rpc_tests.rsindex 319b56b107..3481488951 100644--- a/src/openhuman/memory/read_rpc_tests.rs+++ b/src/openhuman/memory/read_rpc_tests.rs@@ -544,32 +544,44 @@ async fn read_chunk_row_falls_back_to_sqlite_preview_when_file_missing() {assert!(row.content_preview.as_deref().unwrap_or("").contains(body));}+/// The handler forwards the driver's flush outcome onto the wire unchanged.+///+/// The behaviour this test used to stage — an ingest producing a stale buffer,+/// the second flush deduplicating inside the window — is the *driver's* and+/// moved with the SQL to the conformance suite+/// (`flushing_twice_in_a_window_schedules_the_work_once`), where a real store+/// exists. What is the host's here is only the mapping: both fields pass+/// through, and the u64→u32 buffer count clamps rather than wraps.#[tokio::test]-async fn flush_now_enqueues_once_and_reports_stale_buffers() {- let (_tmp, cfg) = test_config();- seed_chat_chunk(- &cfg,- "slack:#eng",- "Phoenix migration ships Friday after the release checklist closes.",- )- .await;- drain_until_idle(&cfg).await.expect("drain jobs");+async fn flush_now_reports_the_drivers_outcome() {+ use crate::openhuman::memory::api::provider::types::FlushOutcome;- let first = flush_now_rpc(&cfg).await.expect("flush_now first");- assert!(first.value.enqueued, "first flush should enqueue work");- assert!(- first.value.stale_buffers >= 1,- "expected at least one stale buffer after ingest"+ let (_tmp, cfg) = test_config();+ crate::openhuman::memory::binding::install_for_test(+ &cfg.workspace_dir,+ &cfg.subsystems.memory,+ std::sync::Arc::new(+ crate::openhuman::memory::binding::FixedDiagnostics::new(+ Default::default(),+ Default::default(),+ )+ .flushing(FlushOutcome {+ enqueued: false,+ stale_buffers: u64::from(u32::MAX) + 7,+ }),+ ) as std::sync::Arc<dyn crate::openhuman::memory::api::provider::MemoryProvider>,);- let second = flush_now_rpc(&cfg).await.expect("flush_now second");+ let resp = flush_now_rpc(&cfg).await.expect("flush_now").value;assert!(- !second.value.enqueued,- "same 3-hour window should dedupe duplicate flush triggers"+ !resp.enqueued,+ "`enqueued: false` passes through — with a non-zero buffer count it \+ means \"already scheduled\", not \"nothing to do\"");- assert!(- second.value.stale_buffers >= 1,- "deduped flush should still report current stale buffer count"+ assert_eq!(+ resp.stale_buffers,+ u32::MAX,+ "a count past the wire type's range clamps rather than wraps to a small lie");}diff --git a/src/openhuman/modules/memory.rs b/src/openhuman/modules/memory.rsindex 9c5a854992..67fea87e74 100644--- a/src/openhuman/modules/memory.rs+++ b/src/openhuman/modules/memory.rs@@ -146,8 +146,9 @@ use tinymemory_api::error::MemoryError;use tinymemory_api::goals::GoalsDoc;use tinymemory_api::health::MemoryHealth;use tinymemory_api::provider::types::{- DiffReport, EntityHit, ExportPage, ExportRecord, ImportOutcome, IngestItem, IngestOutcome,- MaintenanceReport, QueueFailure, QueueStats, SnapshotRef, SourceItem, SourceScope, StoreStats,+ DiffReport, EntityHit, ExportPage, ExportRecord, FlushOutcome, ImportOutcome, IngestItem,+ IngestOutcome, MaintenanceReport, QueueFailure, QueueStats, ResetOutcome, SnapshotRef,+ SourceItem, SourceScope, StoreStats,};use tinymemory_api::provider::{AddressBookSeedOutcome, ChunkDetail, ChunkEmbedding, ChunkQuery, CoverWindowQuery, EntityMatch,@@ -984,6 +985,12 @@ impl MemoryMaintenance for ModuleMemoryProvider {async fn backfill_in_progress(&self) -> Result<bool, MemoryError> {module_call!(self, "backfill_in_progress", "BackfillInProgress", ())}+ async fn flush_pending(&self) -> Result<FlushOutcome, MemoryError> {+ module_call!(self, "flush_pending", "FlushPending", ())+ }+ async fn reset_derived_index(&self) -> Result<ResetOutcome, MemoryError> {+ module_call!(self, "reset_derived_index", "ResetDerivedIndex", ())+ }}#[cfg(test)]@@ -1126,6 +1133,18 @@ impl MemoryRetrieval for ModuleMemoryProvider {(chunk_ids, scope))}+ async fn recall_namespace_recent(+ &self,+ namespace: &str,+ limit: usize,+ ) -> Result<Vec<NamespaceMemoryHit>, MemoryError> {+ module_call!(+ self,+ "recall_namespace_recent",+ "RecallNamespaceRecent",+ (namespace, limit)+ )+ }async fn recall_namespace_scored(&self,namespace: &str,diff --git a/tests/raw_coverage/memory_core_threads_raw_coverage_e2e.rs b/tests/raw_coverage/memory_core_threads_raw_coverage_e2e.rsindex 37479680d4..e46acd8019 100644--- a/tests/raw_coverage/memory_core_threads_raw_coverage_e2e.rs+++ b/tests/raw_coverage/memory_core_threads_raw_coverage_e2e.rs@@ -14,7 +14,7 @@ use tempfile::TempDir;use openhuman_core::openhuman::agent::progress::AgentProgress;use openhuman_core::openhuman::config::Config;use openhuman_core::openhuman::memory::read_rpc::{- self, ChunkFilter, GraphMode, ResetTreeResponse,+ self, ChunkFilter, GraphMode,};use tinymemory_core::tree_source::get_or_create_source_tree;use openhuman_core::openhuman::memory::{@@ -403,12 +403,16 @@ async fn memory_read_rpc_filters_graphs_scores_reset_and_wipe_seeded_rows() {.deleted);- let reset: ResetTreeResponse = read_rpc::reset_tree_rpc(&cfg).await.unwrap().value;- assert!(reset.tree_rows_deleted >= 1);- assert_eq!(reset.chunks_requeued, 1);- assert_eq!(reset.jobs_enqueued, 1);- let flush = read_rpc::flush_now_rpc(&cfg).await.unwrap().value;- assert!(flush.enqueued);+ // `reset_tree` and `flush_now` are deliberately no longer exercised here.+ // Both read and mutate through the bound memory driver now+ // (`Maintenance::reset_derived_index` / `flush_pending`), and an+ // integration test cannot bind one: with nothing bound the resolve+ // refuses, and with a real module on the path it answers from the+ // module's own store rather than the rows staged above. Their behaviour+ // is pinned where a real store exists — the driver's conformance suite+ // (`resetting_the_derived_index_keeps_the_chunks_it_derives_from`,+ // `flushing_twice_in_a_window_schedules_the_work_once`) — and the host's+ // wire mapping in `read_rpc_tests`.fs::create_dir_all(cfg.memory_tree_content_root().join("raw")).unwrap();fs::write(cfg.memory_tree_content_root().join("raw").join("x.md"), "x").unwrap();diff --git a/vendor/tinymemory b/vendor/tinymemoryindex d9a8a6eaf5..238b17994b 160000--- a/vendor/tinymemory+++ b/vendor/tinymemory@@ -1 +1 @@-Subproject commit d9a8a6eaf5c3d4448ff3ccf382075edbed539db1+Subproject commit 238b17994b20f939da59c3533690d2414346c415