Skip to content

test(memory): end-to-end integration tests + migration docs [phase-5] #359

@quangdang46

Description

@quangdang46

Problem

Need to verify that the mempalace-backed memory system produces equivalent or better results compared to native jcode across all key dimensions, and provide user-facing documentation.

Scope

Part A: Integration Tests

Files: New crates/jcode-mempalace-adapter/tests/

  1. Search recall parity:

    • Insert N memories via both backends
    • Search for each memory by content
    • Verify mempalace R@5 >= 95% of native R@5
  2. Cascade retrieval parity:

    • Build graph with edges in both backends
    • Run cascade retrieval from same seed IDs
    • Compare result sets and scores
  3. Confidence scoring parity:

    • Simulate time progression (mock clocks)
    • Verify confidence matches within 5% at multiple time points
    • Verify category-specific half-lives produce different decay rates
  4. Extraction quality:

    • Feed sample transcripts through both extractors
    • Compare extracted memories (count, categories, content overlap)
  5. Maintenance task effects:

    • Run link discovery, verify edges created
    • Run confidence boost/decay, verify scores updated
    • Run pruning, verify low-confidence memories removed
    • Run tag inference, verify tags applied
  6. Data migration fidelity:

    • Create a MemoryGraph with N memories + M edges + C clusters
    • Migrate to mempalace
    • Verify zero data loss: all memories, edges, tags, clusters, embeddings present
    • Verify round-trip: export from mempalace matches original
  7. Latency benchmarks:

    • Benchmark key operations (search, insert, cascade, extraction)
    • Mempalace within 2x of native latency

Part B: Documentation

Files: docs/MEMORY_MIGRATION.md (jcode repo), update docs/MEMORY_ARCHITECTURE.md

  1. How to enable mempalace backend:

    • Config option memory_backend = "mempalace"
    • Required mempalace setup (mpr init, embedding model selection)
  2. Migration process:

    • Step-by-step jcode memory migrate --to-mempalace
    • Expected output and timing
    • Verification steps
  3. Rollback guide:

    • How to switch back to memory_backend = "native"
    • What data is preserved (.bak files)
    • Known limitations of rollback
  4. Architecture docs update:

    • Dual-backend design diagram
    • Data flow for both paths
    • Feature parity matrix
  5. Troubleshooting:

    • Embedding model mismatch
    • KG schema migration failures
    • Common error messages and fixes

Acceptance Criteria

Tests

  • Search recall >= 95% of native backend
  • Confidence scores match within 5%
  • Zero data loss on migration (all memories, edges, clusters, embeddings)
  • Latency within 2x of native
  • All test cases pass in CI

Docs

  • New user can follow docs to enable mempalace + migrate data
  • Rollback procedure documented and tested
  • Architecture diagram reflects dual-backend design

Dependencies

Reference

jcode existing memory tests: crates/jcode-base/src/memory_tests.rs (624 lines)
jcode memory agent tests: crates/jcode-base/src/memory_agent_tests.rs
jcode architecture docs: docs/MEMORY_ARCHITECTURE.md
jcode memory budget: docs/MEMORY_BUDGET.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    mp-migrationjcode → mempalace memory migrationphase-5Migration Phase 5 (jcode adapter)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions