Skip to content

v0.2.0 — sleep-time maintenance with human review

Choose a tag to compare

@Wuesteon Wuesteon released this 16 Jul 17:00
· 69 commits to main since this release

Added

  • Sleep-time maintenance — an offline job that cleans up stored memory
    between sessions (dedupe, summarize-old, evict-low-value) while preserving the
    ADD-only spine and as-of query semantics. Nothing is ever deleted: maintenance
    only appends, retires via the existing superseded_by flip, or demotes to a
    cold tier, so full history stays queryable at any past point in time —
    bit-for-bit identical at the store visibility predicate, pinned by executable
    tests. Design:
    docs/superpowers/specs/2026-07-16-sleep-time-maintenance-design.md.
    • lean-memory-maintain CLI (in the core package beside lean-memory-mcp)
      — dry-run by default; --apply runs the auto band and stages proposals,
      --auto-only runs only the provably-safe band, --json emits a
      machine-readable report. --root defaults to $LM_DATA_ROOT; --namespace
      scopes to one namespace. Ships a cron/launchd recipe in the README.
    • Two-tier autonomy — only exact-duplicate retirement and a strict
      eviction band auto-apply. Near-duplicate merges, summaries, and softer
      evictions are staged as proposals a human reviews; an unreviewed proposal
      expires after 30 days (default) rather than auto-applying — silence is
      never consent.
    • Console Review page — the memory console gains a Review page: the
      pending-proposal queue grouped by entity with per-kind before/after
      evidence, Approve / Keep / Edit-then-approve / Promote verbs, batch-approve
      per entity, and a run-maintenance button (dry-run by default, apply behind
      a confirm). Backed by five auth-gated console routes
      (/views/{ns}/review/*, /views/{ns}/maintenance/*) that reach the engine
      only through the gateway; double-decides surface as HTTP 409 with the
      compare-and-set outcome passed through, so the console and Claude Code can
      review the same queue without double-applying. Also closes the four WP10a
      carry-in cleanups (summarizer budget-check ordering, CLI missing-namespace
      guard, Store.path on the ABC, tool-docstring apply/auto-spawn asymmetry).
    • Conversational review in Claude Code — four MCP tools
      (memory_maintenance_run, dry-run by default; memory_maintenance_status,
      model-free; memory_review_queue; memory_review_decide) on the core
      lean-memory-mcp server plus both console MCP surfaces, a
      review-memory-maintenance MCP prompt (console MCP surfaces), and a /review-memory plugin command
      that walks the queue grouped by entity and records only explicit user
      verdicts.
    • Tier-filtered retrieval — default latest-mode search hides cold-demoted
      facts; as_of queries never filter tier, and search(..., include_cold=True)
      opts out. Promotion back to hot is explicit-only — reads never durably change
      surfaces.
    • Schema v2 — user_version-gated 1→2 migration (v1-format files upgrade
      in place, verified by a checked-in fixture) adding record_kind,
      fact_derivation lineage, and the maintenance_run / maintenance_proposal
      ledger tables. Two exact-no-op ingest hooks (duplicate-cascade,
      summary-staleness cascade) keep offline transforms coherent under later
      ingest; both are byte-identical no-ops until maintenance has ever run.
    • Concurrency & crash safety — engine-wide PRAGMA busy_timeout, a
      batch() unit-of-work, an atomic maintenance lease with heartbeat and
      crash-resume, and memory_clear refusing while a live maintenance lease is
      held. LM_MAINT_AUTO=1 opts into a detached background auto-run on the first
      tool call of a stale namespace (off by default).

Full changelog: CHANGELOG.md