feat(jcode): MemoryProvider trait + MemoryBackend enum + provider() factory#319
Open
quangdang46 wants to merge 5 commits into
Open
feat(jcode): MemoryProvider trait + MemoryBackend enum + provider() factory#319quangdang46 wants to merge 5 commits into
quangdang46 wants to merge 5 commits into
Conversation
…() factory (mp-040, mp-041, mp-042)
- Add MemoryProvider trait + GraphStats + MemoryProviderConfig in jcode-memory-types
- Add MemoryBackend::{Local, Mempalace} to AgentsConfig
- Add provider() factory returning DynMemoryProvider
- Implement MemoryProvider for MemoryManager (JcodeLocalProvider)
Note: mr-mp-043 (call site migration) and mr-mp-060 (adapter write-through)
are deferred pending architectural work (graph-loading methods on trait, adapter crate).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
… factory (mp-044) - Add crates/jcode-mempalace-adapter: MempalaceProvider impl of jcode MemoryProvider backed by mempalace-core Palace - Type bridge: jcode MemoryEntry↔mempalace Drawer, String ID↔DrawerId, jcode GraphStats↔mempalace KgStats via tokio::Handle::block_on for sync calls - Wire MempalaceProvider into provider() factory using OnceLock lazy init - Remove #[non_exhaustive] from mempalace SearchScope to allow external construction - Add Clone impl for Palace (all fields are Arc so it's safe)
…WriteThroughProvider flush - lib.rs: use anyhow::Result instead of unqualified Result<T> - event_capture_bridge.rs: fix into_box(self) not Arc<Self> - write_through.rs: remove flush() (not in mempalace MemoryProvider trait) - event_capture_bridge.rs, write_through.rs: new files for Phase 4 - Switch mempalace-core to local path for development iteration - Add tracing dependency for EventCaptureBridge logging ref: mp-044 mr-jcode-mempalace-adapter-crate-en93
…vider - Fix field type: Arc<dyn mempalace_core::MemoryProvider> → Arc<dyn jcode_memory_types::MemoryProvider> (was wrong trait) - on_session_start → remember_project (session context) - on_user_prompt_submit → remember_project (file prompts) - on_post_tool_use → remember_project (success only; failures skipped) - on_pre_tool_use / on_memory_write / on_stop / on_embedder_ready → log only Closes mr-event-capture-wiring-w6li
- remember_project/global: preserve ALL metadata (tags, source, category, id) by using entry_to_drawer + palace.add_drawer (not palace.remember which only stores content) - list_all_scoped: actually list drawers via palace.get_drawers() + new drawer_to_entry() converter (was returning empty vec) - hit_to_entry: use hit.source_file as id placeholder (document palace SearchHit has no id field limitation) Closes mr-adapter-write-through-3qb5 (write-through pattern now preserves metadata)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
MemoryProvidertrait +GraphStats+MemoryProviderConfiginjcode-memory-typesMemoryProviderforMemoryManager(JcodeLocalProvider, zero-behaviour-change refactor)AgentsConfig.memory_backend(Local/Mempalace) +provider()factory returningDynMemoryProviderTest plan
cargo check -p jcode-memory-typescargo check -p jcode --lib(pre-mempalace adapter work)cargo build -p jcodeNotes
MemoryProviderlacks graph-loading methods (needs trait extension first)jcode-mempalace-adaptercrate doesn't exist yet🤖 Generated with Claude Code