v1.0.6- Major Bug Fixes and Optimization
What's Changed
Bug Fixes (22 issues)
Core Engine & Retrieval
- Replace word-split
countTokenswith shared BPE tokenizer fromtokenBudget.ts - Add WAL mode + performance pragmas (
busy_timeout,cache_size) toopenDb - Replace 4-band step-function recency scoring with smooth exponential decay (14-day half-life)
- Add
MAX_SEMANTIC_CANDIDATES=2000limit tosearchMemoryCandidates - Wire unused
decayOldBoostsinto retrieval pipeline before scoring - Add embedding version mismatch awareness — stale embeddings get neutral 0.5 score; added
sessionmem re-embedCLI command
Summarization & Cloud
- Implement real cloud summarization via Anthropic SDK (was a non-functional stub)
- Default model set to
claude-sonnet-4-6, centralized inpolicyConfig.ts - Record cloud summarizer failures in
summarization_failurestable before local fallback (was silently swallowed)
Code Quality
- Extract magic numbers to
policyConfig.ts(MIN_IMPORTANCE,MAX_IMPORTANCE,CRITICAL_WARNING_IMPORTANCE_THRESHOLD,DEEP_MODE_RETRIEVAL_CAP) - Add per-session write soft limit (
SESSION_WRITE_SOFT_LIMIT=50) with warning inwarningCodes - Record
manual_deletefeedback inmemory_feedbacktable onforgetMemory - Fix stale CLI output tests — add missing fields, correct column index, export
MemoryTableRow
CI/CD & Distribution
- Fix GitHub Actions versions (
checkout@v4,setup-node@v5) across all workflows - Replace hardcoded
.mcp.jsonwith portable.mcp.json.exampleusingnpx - Delete duplicate
publish.ymlworkflow — onlyrelease.ymlpublishes now - Pin
trivy-actiontov0.28.0(was unpinned@master) - Sync all manifest versions + add
postversionnpm hook for automatic syncing - Dockerfile: pin package version
@1.0.6, add non-rootsessionmemuser
Adapter & CLI
- Expand startup log with db path, project ID; stderr debug output gated by
SESSIONMEM_DEBUG=1 - Wire fallback tools (
fetch_memories,startup_inject_memories) into MCP server with real execute bodies
Performance Optimizations
- Statement caching — WeakMap-based prepared statement caching across all 6 storage repo files. Each SQL statement compiled once per DB lifetime, not once per call.
- Batch store —
batchStoreMemorywraps multiple inserts in single SQLite transaction. Registered asbatchStoreMemoriesMCP tool. ~10x faster for session-end writes. - SQL pre-filter — Candidate loading now filters at SQL level: keeps
importance >= 8ORupdated_atwithin 90 days. Excludes stale low-signal memories before cosine similarity. - FTS5 pre-filtering — Full-text search narrows candidates to ~50 FTS matches before cosine similarity computation. Falls back to full scan when keyword overlap is poor.
Stats
- Tests: 370 passing across 72 files
- New migrations: 007 (feedback manual_delete), 008 (FTS5 search)
- New dependency:
@anthropic-ai/sdk(cloud summarization)
Full Changelog: v1.0.0...v1.0.6