Skip to content

mesh-mem v0.2.5

Choose a tag to compare

@h-wata h-wata released this 19 May 02:15
· 100 commits to main since this release

Highlights

  • Shadow retention sweep (#70): gc --retention-days now also prunes long-shadowed index rows (after #67's shadow-delete reconcile). Re-verifies each candidate against live Zenoh state — false-shadows are upserted back to live, genuine expiries are physically deleted. Output reads retention N-day sweep: physically deleted {n} tombstones / {m} shadows (revived {k}). --no-shadow-prune opts out.
  • i18n: user-facing CLI / MCP runtime strings are now English (#53). mesh-mem CLI prints and MCP tool returns (save_observation, search_memory, get_memory, delete_memory, get_memory_status, drain_pending_puts) used to mix Japanese and English; they are now uniformly English to match the already-English logger.* output. The "前にやった" hint inside MCP instructions is intentionally preserved so the agent still recognizes Japanese user input as a search trigger.
  • Rebuild reconcile fixes ghost rows (#67): LocalIndex.rebuild_from_zenoh was add-only and left long-lived ghost rows after Zenoh-side purges on offline peers. Rebuild now marks existing - zenoh_set rows as shadowed; tombstones remain stronger than shadows; live rows whose payload_json is unchanged are skipped to avoid WAL inflation on populated meshes.
  • Replication subscriber mirrors Zenoh DELETE into the SQLite index (#64). Previously gc --by-pc-id --execute on one peer purged Zenoh + that peer's index but left ghost rows on every other peer (~11.7 万件 observed on dogfood). Subscriber now dispatches on sample.kind and calls LocalIndex.physical_delete for DELETE samples.
  • Local fallback queue for failed puts (#50, #57). Retryable put_observation / put_tombstone failures are persisted to state_dir()/pending_puts.db and replayed automatically by the MCP daemon background drain, or manually via mesh-mem drain --pending / the MCP drain_pending_puts tool.
  • search --format {text,markdown,json} (#58) for stable machine-oriented output. Sample Claude Code SessionStart hook script ships in scripts/hooks/session-start.sh.

Breaking

  • Japanese substring grep on CLI / MCP output no longer matches (#53). Scripts relying on 保存完了 / 削除 / 件数 / 該当するメモリ / キャンセルしました / 物理削除完了 / bulk delete 対象 etc. must update their patterns to the new English equivalents (saved / deleted / count (within limit ...) / No matching memories / cancelled. / physically deleted / bulk delete target: N entries).
  • TransportStatus schema gained pending_puts: int. Callers destructuring the dataclass must pick up the new field.
  • SQLite local index schema migrates v1 → v2 (adds shadowed_at TEXT column). Migration is forward-only; existing rows are treated as live until the next rebuild revisits them.

Added

  • gc --retention-days shadow sweep + --no-shadow-prune opt-out (#70).
  • LocalIndex.mark_shadowed_missing + VisibilityCounts; get_memory_status now reports index_rows: live=N / tomb=N / shadow=N.
  • Local fallback queue for failed puts (#50). Daemon and manual drain (#57). pending_puts exposed in CLI status and MCP get_memory_status.
  • mesh-mem search --format {text,markdown,json} (#58); machine-oriented JSON + single-line markdown for SessionStart hooks; sample hook script.

Changed

  • All user-facing CLI / MCP runtime strings translated to English (#53). _INSTRUCTIONS keeps "前にやった" intentionally.
  • Drain progress surfaced in status output (in-progress flag, last-run timestamp, cumulative drained count).

Fixed

  • Rebuild now reconciles SQLite index against Zenoh, not just appends (#67, ADR-0011).
  • Replication subscriber dispatches on sample.kind and physically deletes the index row for DELETE samples (#64).
  • get_memory_status exposes shadow / tomb / live counts.

Upgrade note

Reinstall the editable venv to refresh __version__ metadata:

~/work/mesh-mem/.venv/bin/pip install -e .

Then /mcp reconnect (or restart your MCP host).

If your existing peer index has accumulated ghost rows from before #64 / #67, the next gc --retention-days run will sweep them via the new shadow path (re-verifying each candidate against live Zenoh).

See CHANGELOG.md for full details.