Skip to content

refactor(memory): Arc-wrap EmbeddingStore and FuturesUnordered context preparation (#1223)#1244

Merged
bug-ops merged 2 commits intomainfrom
feat-m33-arc-wrap-futures
Mar 5, 2026
Merged

refactor(memory): Arc-wrap EmbeddingStore and FuturesUnordered context preparation (#1223)#1244
bug-ops merged 2 commits intomainfrom
feat-m33-arc-wrap-futures

Conversation

@bug-ops
Copy link
Copy Markdown
Owner

@bug-ops bug-ops commented Mar 5, 2026

Summary

  • Wrap EmbeddingStore in Arc<EmbeddingStore> inside SemanticMemory for shared access from future background extraction tasks
  • Replace dual cfg-gated try_join! blocks in prepare_context with FuturesUnordered + ContextSlot enum for extensible concurrent context fetching
  • Preserve ContentSanitizer integration from [SEC-1.4] ContextBuilder sanitizer integration #1199 across all context source paths

Prerequisite refactors for graph memory epic (#1222). Resolves #1223.

Changes

File Change
crates/zeph-memory/src/semantic.rs qdrant field: Option<EmbeddingStore> -> Option<Arc<EmbeddingStore>>
crates/zeph-memory/src/testing.rs mock_semantic_memory() wraps EmbeddingStore in Arc::new()
crates/zeph-core/src/agent/context.rs ContextSlot enum + FuturesUnordered pattern replacing try_join!
CHANGELOG.md Entry under [Unreleased]

Test plan

  • cargo +nightly fmt --check passes
  • cargo clippy --workspace --features full -- -D warnings passes
  • cargo nextest run --workspace --features full --lib --bins: 3987 passed, 0 failed
  • Security review: ContentSanitizer preserved on all 5 memory paths + code RAG
  • Performance review: zero Arc::clone() per turn, ~2-5ns overhead from FuturesUnordered
  • Adversarial critique: all 10 checks pass

…t preparation (#1223)

Prerequisite refactors for graph memory epic (#1222):

- Wrap EmbeddingStore in Arc<EmbeddingStore> inside SemanticMemory for
  shared access from future background extraction tasks
- Replace dual cfg-gated try_join! blocks in prepare_context with
  FuturesUnordered + ContextSlot enum for extensible concurrent context
  fetching without combinatorial cfg explosion
- Preserve ContentSanitizer integration from #1199 across all context
  source paths
@github-actions github-actions bot added refactor Code refactoring without functional changes documentation Improvements or additions to documentation memory zeph-memory crate (SQLite) rust Rust code changes core zeph-core crate size/M Medium PR (51-200 lines) and removed refactor Code refactoring without functional changes labels Mar 5, 2026
@bug-ops bug-ops enabled auto-merge (squash) March 5, 2026 18:21
@github-actions github-actions bot added the refactor Code refactoring without functional changes label Mar 5, 2026
@bug-ops bug-ops merged commit 5c1029b into main Mar 5, 2026
25 checks passed
@bug-ops bug-ops deleted the feat-m33-arc-wrap-futures branch March 5, 2026 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core zeph-core crate documentation Improvements or additions to documentation memory zeph-memory crate (SQLite) refactor Code refactoring without functional changes rust Rust code changes size/M Medium PR (51-200 lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor(memory): Arc-wrap EmbeddingStore and FuturesUnordered context preparation

1 participant