Repository navigation
v0.2.0 — sleep-time maintenance with human review
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 existingsuperseded_byflip, 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-maintainCLI (in the core package besidelean-memory-mcp)
— dry-run by default;--applyruns the auto band and stages proposals,
--auto-onlyruns only the provably-safe band,--jsonemits a
machine-readable report.--rootdefaults 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
Reviewpage: 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.pathon 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-mcpserver plus both console MCP surfaces, a
review-memory-maintenanceMCP prompt (console MCP surfaces), and a/review-memoryplugin 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_ofqueries never filter tier, andsearch(..., 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) addingrecord_kind,
fact_derivationlineage, and themaintenance_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, andmemory_clearrefusing while a live maintenance lease is
held.LM_MAINT_AUTO=1opts into a detached background auto-run on the first
tool call of a stale namespace (off by default).
Full changelog: CHANGELOG.md