superlocalmemory 4.0.4 → 4.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/CHANGELOG.md +90 -0
  2. package/README.md +23 -14
  3. package/ide/configs/codex-mcp.toml +2 -2
  4. package/package.json +3 -1
  5. package/plugin/.claude-plugin/plugin.json +1 -1
  6. package/plugin/.mcp.json +1 -0
  7. package/plugin/CLAUDE.md +3 -3
  8. package/plugin/agents/slm-governance-advisor.md +1 -1
  9. package/plugin/agents/slm-loop-runner.md +1 -1
  10. package/plugin/agents/slm-memory-advisor.md +1 -1
  11. package/plugin/agents/slm-optimize-advisor.md +1 -1
  12. package/plugin/requirements.txt +1 -1
  13. package/plugin/skills/slm-cache/SKILL.md +1 -1
  14. package/plugin/skills/slm-compress/SKILL.md +1 -1
  15. package/plugin/skills/slm-governance/SKILL.md +1 -1
  16. package/plugin/skills/slm-graph/SKILL.md +3 -2
  17. package/plugin/skills/slm-loop/SKILL.md +1 -1
  18. package/plugin/skills/slm-mesh/SKILL.md +1 -1
  19. package/plugin/skills/slm-profile/SKILL.md +2 -1
  20. package/plugin/skills/slm-recall/SKILL.md +1 -1
  21. package/plugin/skills/slm-remember/SKILL.md +1 -1
  22. package/plugin/skills/slm-scope/SKILL.md +1 -1
  23. package/plugin/skills/slm-session/SKILL.md +1 -1
  24. package/plugin/skills/slm-status/SKILL.md +1 -1
  25. package/plugin-src/rules/AGENTS.md +6 -5
  26. package/plugin-src/skills/slm-graph/SKILL.md +2 -1
  27. package/plugin-src/skills/slm-profile/SKILL.md +1 -0
  28. package/pyproject.toml +1 -1
  29. package/src/superlocalmemory/__init__.py +1 -1
  30. package/src/superlocalmemory/access/rbac.py +106 -0
  31. package/src/superlocalmemory/brain/__init__.py +5 -0
  32. package/src/superlocalmemory/brain/truth.py +418 -0
  33. package/src/superlocalmemory/cli/__main__.py +17 -0
  34. package/src/superlocalmemory/cli/commands.py +96 -28
  35. package/src/superlocalmemory/cli/gdpr_cmd.py +779 -0
  36. package/src/superlocalmemory/cli/gdpr_io.py +109 -0
  37. package/src/superlocalmemory/cli/main.py +88 -0
  38. package/src/superlocalmemory/code_graph/extractors/__init__.py +17 -0
  39. package/src/superlocalmemory/code_graph/graph_store.py +180 -3
  40. package/src/superlocalmemory/code_graph/parser.py +280 -100
  41. package/src/superlocalmemory/compliance/gdpr.py +358 -0
  42. package/src/superlocalmemory/core/config.py +44 -1
  43. package/src/superlocalmemory/core/context_cache.py +58 -1
  44. package/src/superlocalmemory/core/engine_wiring.py +5 -1
  45. package/src/superlocalmemory/core/maintenance.py +43 -1
  46. package/src/superlocalmemory/core/mutations.py +155 -25
  47. package/src/superlocalmemory/core/recall_pipeline.py +6 -10
  48. package/src/superlocalmemory/core/recall_worker.py +33 -12
  49. package/src/superlocalmemory/core/remember_runtime.py +271 -2
  50. package/src/superlocalmemory/core/store_pipeline.py +100 -38
  51. package/src/superlocalmemory/encoding/consolidator.py +17 -47
  52. package/src/superlocalmemory/encoding/temporal_validator.py +14 -18
  53. package/src/superlocalmemory/hooks/user_prompt_hook.py +1 -1
  54. package/src/superlocalmemory/infra/backup.py +138 -0
  55. package/src/superlocalmemory/infra/backup_obligations.py +423 -0
  56. package/src/superlocalmemory/integrations/bounded_loops_mcp.py +4 -3
  57. package/src/superlocalmemory/learning/engagement.py +165 -0
  58. package/src/superlocalmemory/mcp/profiles.py +19 -7
  59. package/src/superlocalmemory/mcp/server.py +4 -2
  60. package/src/superlocalmemory/mcp/tools_brain.py +54 -10
  61. package/src/superlocalmemory/mcp/tools_code_graph.py +31 -4
  62. package/src/superlocalmemory/mcp/tools_core.py +88 -3
  63. package/src/superlocalmemory/mcp/tools_v3.py +20 -6
  64. package/src/superlocalmemory/retrieval/engine.py +28 -10
  65. package/src/superlocalmemory/retrieval/remote_reranker.py +108 -11
  66. package/src/superlocalmemory/retrieval/temporal_validity_filter.py +119 -19
  67. package/src/superlocalmemory/server/routes/brain.py +297 -14
  68. package/src/superlocalmemory/server/routes/learning.py +13 -25
  69. package/src/superlocalmemory/server/routes/memories.py +129 -3
  70. package/src/superlocalmemory/server/routes/v3_api.py +171 -60
  71. package/src/superlocalmemory/storage/_migration_internals.py +4 -0
  72. package/src/superlocalmemory/storage/_schema_version.py +2 -2
  73. package/src/superlocalmemory/storage/correction_cases.py +670 -0
  74. package/src/superlocalmemory/storage/database.py +230 -24
  75. package/src/superlocalmemory/storage/migration_runner.py +7 -0
  76. package/src/superlocalmemory/storage/migrations/M042_correction_case_ledger.py +245 -0
  77. package/src/superlocalmemory/storage/migrations/__init__.py +2 -0
  78. package/src/superlocalmemory/storage/models.py +12 -4
  79. package/src/superlocalmemory/storage/write_coordinator.py +4 -0
  80. package/src/superlocalmemory/summaries/__init__.py +37 -0
  81. package/src/superlocalmemory/summaries/base.py +108 -0
  82. package/src/superlocalmemory/summaries/daily_reflection.py +293 -0
  83. package/src/superlocalmemory/summaries/project_work_log.py +424 -0
  84. package/src/superlocalmemory/summaries/session_summary.py +307 -0
  85. package/src/superlocalmemory/ui/css/design-system.css +76 -1
  86. package/src/superlocalmemory/ui/index.html +28 -11
  87. package/src/superlocalmemory/ui/js/brain.js +43 -7
  88. package/src/superlocalmemory/ui/js/od-agents.js +49 -5
  89. package/src/superlocalmemory/ui/js/od-brain.js +280 -84
  90. package/src/superlocalmemory/ui/js/od-graph.js +147 -6
package/CHANGELOG.md CHANGED
@@ -5,6 +5,96 @@ All notable changes to SuperLocalMemory will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [4.0.6] — The Connected Brain
9
+
10
+ ### Added
11
+ - **The Living Brain, rewritten for people who do not read telemetry.** The Brain
12
+ section now leads with the number of questions your memory has answered rather
13
+ than a raw event count, names its ranking phase in words, and stops presenting
14
+ a starting value as a measured result. Source quality no longer lists internal
15
+ identifiers; when nothing has been measured yet it says so and explains what
16
+ would change that.
17
+ - **Session, daily and project summaries.** A readable layer over your memories:
18
+ what a session covered, what a day's main topics were, and what was worked on
19
+ per project. Each one links back to the memories it came from, and each states
20
+ how much of the underlying data it could actually cover. Requested in #113.
21
+ - **Entity-level memory consolidation now runs.** Repeated facts about the same
22
+ entity are merged during maintenance, and the originals are archived rather
23
+ than deleted.
24
+ - **Codex and Bounded Loops appear in Connected clients.** Codex is listed with
25
+ the configuration that proves it, and Bounded Loops is detected when installed,
26
+ with its version and the bridge it speaks.
27
+
28
+ ### Fixed
29
+ - **The knowledge graph no longer opens blank.** Previously the graph could
30
+ render nothing on first open — and again when you returned to it — until you
31
+ moved the node slider. Two separate causes: the view framed itself against a
32
+ canvas that had no size yet, and re-entering the pane cleared the canvas
33
+ without redrawing it. Default node count is now 50.
34
+ - **The graph's details and chat panel is reachable on smaller screens.** Below
35
+ 1100px it stacks under the graph, a full screen-height out of view; there is
36
+ now a control to reach it and a way back.
37
+ - **Presence tells you when it has stopped being recorded.** A gap in recording
38
+ previously looked identical to "no agents are active".
39
+ - **Recall no longer fails when the reranker returns no scores.** It falls back
40
+ to its existing ranking instead of raising.
41
+ - Storage: per-call connections now disable checkpoint-on-close
42
+ (`SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE`), removing a version-dependent blocking
43
+ close path. On SQLite builds whose close-path checkpoint can block, closing a
44
+ WAL-mode connection may wait on reader marks pinned by another connection
45
+ while holding SQLite's process-global VFS mutex, convoying every later
46
+ connection in the process; `PRAGMA busy_timeout` does not apply to that path.
47
+ Reported, diagnosed and fixed by **@kenyonxu** (#118), from a production
48
+ postmortem plus an in-suite reproduction.
49
+ Scope note: on SQLite 3.49.1 the close-path checkpoint is passive — measured
50
+ at 0.075 ms with a full WAL and a pinned reader mark — so the convoy is not
51
+ reproducible there. This change is therefore hardening: it makes the
52
+ non-blocking close explicit rather than depending on the behaviour of a
53
+ particular SQLite build.
54
+ - Storage: per-call connections now also set `PRAGMA wal_autocheckpoint=400`.
55
+ This pragma is per-connection and is not persisted in the database file, so
56
+ it previously applied only to the short-lived initialisation connection and
57
+ every working connection silently fell back to SQLite's default of 1000
58
+ frames. With checkpoint-on-close disabled, autocheckpoint is the only
59
+ remaining checkpoint path, so the intended value must be set where the
60
+ writes actually happen.
61
+ - Storage: when checkpoint-on-close cannot be disabled (Python 3.11, which
62
+ predates `Connection.setconfig`), this is now logged once instead of failing
63
+ silently, so operators know the deadlock hardening is inactive.
64
+
65
+ ## [4.0.5] - 2026-08-16 — Reviewed time-aware corrections
66
+
67
+ ### Added
68
+ - M042 adds a profile-scoped, append-only correction ledger in `memory.db`.
69
+ CLI, MCP, and authenticated HTTP expose a propose/list/review lifecycle with
70
+ compare-and-swap versions; no correction stores raw fact text in its ledger.
71
+ - `BrainTruth v1` is now shared by `slm brain`, MCP, HTTP, and the Living Brain
72
+ dashboard. It reports memory activity, feedback, receipt claims, external
73
+ evidence, and correction quality independently and marks unavailable sources
74
+ instead of fabricating zeroes.
75
+ - A generated isolated performance/liveness gate records 50 warm recalls, 50
76
+ canonical remember acknowledgements, current-truth admission overhead, and
77
+ a 60-second 10-reader/2-writer run without opening user memory data.
78
+
79
+ ### Changed
80
+ - Direct memory edits create immutable review-required successors. `apply`
81
+ makes the successor current and transaction-expires the predecessor;
82
+ `reject` preserves current truth; `rollback` restores the predecessor's
83
+ temporal state.
84
+ - Current truth admission covers channel results, profile shortcuts, bridge and
85
+ scene expansion, pins, and cache hits. Admission failures abstain rather
86
+ than returning potentially stale facts. The hot path uses one bounded
87
+ lifecycle read per recall and rechecks only newly expanded candidates.
88
+ - Default ranking remains `off` unless an operator explicitly configures a
89
+ ranking mode. M040/M041 observations and correction cases do not become
90
+ ranking or model-routing inputs.
91
+
92
+ ### Safety
93
+ - Correction history prevents an ordinary forget from producing an opaque
94
+ writer failure; it returns an explicit conflict for any correction-linked
95
+ fact. A dedicated erasure workflow remains responsible for privacy deletion
96
+ across both fact and ledger.
97
+
8
98
  ## [4.0.4] - 2026-08-15 — Optional Bounded Loops evidence bridge
9
99
 
10
100
  ### Added
package/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  </picture>
6
6
  </p>
7
7
 
8
- <h1 align="center">SuperLocalMemory V4.0.4</h1>
8
+ <h1 align="center">SuperLocalMemory V4.0.6</h1>
9
9
 
10
10
  <h2 align="center">Rent the LLM. Own the memory.</h2>
11
11
 
@@ -27,12 +27,12 @@ guarantee here is stated as a falsifiable invariant, tested under an adversarial
27
27
  negative control, and shipped with the harness that regenerates the evidence:
28
28
  <code>python benchmark/run_all.py --trials 200 --output-dir results/</code>. What each experiment
29
29
  does <em>not</em> exercise is stated too.</p>
30
- <p align="center"><code>v4.0.4</code> — one control plane: <strong>SLM-Mesh</strong> peer coordination · multi-scope memory (personal / shared / global) · profiles · Cache · Compress · 7-layer retrieval · code graph · Entity Explorer · skill evolution · Modes A/B/C · GDPR retention &amp; audit chain · bounded loops — across CLI, MCP, dashboard, the <strong>Claude plugin</strong>, the <strong>Codex add-on</strong>, and documented IDE integrations.<br/>
30
+ <p align="center"><code>v4.0.6</code> — one control plane: <strong>SLM-Mesh</strong> peer coordination · multi-scope memory (personal / shared / global) · profiles · Cache · Compress · 7-layer retrieval · code graph · Entity Explorer · skill evolution · Modes A/B/C · GDPR retention &amp; audit chain · bounded loops — across CLI, MCP, dashboard, the <strong>Claude plugin</strong>, the <strong>Codex add-on</strong>, and documented IDE integrations.<br/>
31
31
  Proxy: <code>slm wrap claude</code> &nbsp;·&nbsp; MCP: add <code>slm_compress</code> to your config &nbsp;·&nbsp; Skill: zero-config</p>
32
32
  <p align="center"><strong>Four public arXiv preprints</strong> · V4: <a href="https://arxiv.org/abs/2608.08253">arXiv:2608.08253</a> · companion archive: <a href="https://zenodo.org/records/21853302">Zenodo 21853302</a> (<a href="https://doi.org/10.5281/zenodo.21853302">DOI 10.5281/zenodo.21853302</a>) · prior preprints: <a href="https://arxiv.org/abs/2603.02240">2603.02240</a> · <a href="https://arxiv.org/abs/2603.14588">2603.14588</a> · <a href="https://arxiv.org/abs/2604.04514">2604.04514</a>.</p>
33
33
 
34
34
  <p align="center">
35
- <a href="CHANGELOG.md"><img src="https://img.shields.io/badge/v4.0.4-Current_Release-2ea44f?style=for-the-badge&logo=checkmarx&logoColor=white" alt="v4.0.4 — Current Release"/></a>
35
+ <a href="CHANGELOG.md"><img src="https://img.shields.io/badge/v4.0.6-Current_Release-2ea44f?style=for-the-badge&logo=checkmarx&logoColor=white" alt="v4.0.6 — Current Release"/></a>
36
36
  <a href="https://arxiv.org/abs/2608.08253"><img src="https://img.shields.io/badge/arXiv-2608.08253-b31b1b?style=for-the-badge&logo=arxiv&logoColor=white" alt="SuperLocalMemory 4.0 paper on arXiv:2608.08253"/></a>
37
37
  <a href="https://zenodo.org/records/21853302"><img src="https://img.shields.io/badge/Zenodo-10.5281%2Fzenodo.21853302-1682D4?style=for-the-badge&logo=zenodo&logoColor=white" alt="V4 paper on Zenodo: 10.5281/zenodo.21853302"/></a>
38
38
  <a href="https://arxiv.org/abs/2603.14588"><img src="https://img.shields.io/badge/arXiv-2603.14588-b31b1b?style=for-the-badge&logo=arxiv&logoColor=white" alt="arXiv Paper"/></a>
@@ -41,7 +41,7 @@ Proxy: <code>slm wrap claude</code> &nbsp;·&nbsp; MCP: add <code>slm_compress</
41
41
  <a href="https://www.npmjs.com/package/superlocalmemory"><img src="https://img.shields.io/npm/v/superlocalmemory?style=for-the-badge&logo=npm&logoColor=white" alt="npm"/></a>
42
42
  <a href="https://www.gnu.org/licenses/agpl-3.0"><img src="https://img.shields.io/badge/License-AGPL_v3-blue.svg?style=for-the-badge" alt="AGPL v3"/></a>
43
43
  <a href="#privacy-controls-and-operating-modes"><img src="https://img.shields.io/badge/Privacy-Deployment_Assessed-brightgreen?style=for-the-badge" alt="Privacy controls require deployment assessment"/></a>
44
- <a href="#teams-and-enterprise-memory-v4"><img src="https://img.shields.io/badge/Enterprise-GDPR_%7C_EU_AI_Act-0b5394?style=for-the-badge" alt="Enterprise governance: GDPR and EU AI Act controls"/></a>
44
+ <a href="#teams-and-enterprise-memory-v4"><img src="https://img.shields.io/badge/Enterprise-GDPR_%7C_EU_AI_Act_controls-0b5394?style=for-the-badge" alt="Enterprise governance: GDPR and EU AI Act controls"/></a>
45
45
  <a href="https://superlocalmemory.com"><img src="https://img.shields.io/badge/Web-superlocalmemory.com-ff6b35?style=for-the-badge" alt="Website"/></a>
46
46
  <a href="#dual-interface-mcp--cli"><img src="https://img.shields.io/badge/MCP-Native-blue?style=for-the-badge" alt="MCP Native"/></a>
47
47
  <a href="#dual-interface-mcp--cli"><img src="https://img.shields.io/badge/CLI-Agent--Native-green?style=for-the-badge" alt="CLI Agent-Native"/></a>
@@ -62,7 +62,16 @@ SuperLocalMemory V4 combines conventional dense and lexical retrieval with graph
62
62
 
63
63
  **Memory with a sense of time.** SLM does not only store *what* an agent learned — it records *when*. Every fact carries ingestion timing and provenance; recall runs a dedicated temporal candidate channel alongside semantic, lexical, and associative retrieval; scenes and entity timelines reconstruct sequence; and the lifecycle lets neglected memory decay and self-archive instead of growing without bound. Time is a first-class ranking and lifecycle signal rather than a timestamp column an agent never reads — which is what lets a long-lived agent reason about how its context changed, not only what it currently holds.
64
64
 
65
- **What V4.0.4 ships.** Existing users can now preview and explicitly refresh SLM-owned host integrations with `slm upgrade-hosts`, while package installation and MCP startup no longer silently modify host hook configuration. V4.0.4 also adds an optional, capability-negotiated Bounded Loops observation bridge: compatible terminal graph receipts enter a separate, profile-scoped `learning.db` table and appear in Living Brain, without affecting recall, ranking, routing, or automatic learning. V4 remains a *governed* local-first control plane every canonical write is admitted, policy-authorized, tracked as durable per-store obligations (lexical, temporal, vector), and sealed by a completion manifest, so it is either fully applied or explicitly marked degraded, never silently half-done. Flagship surfaces in this release:
65
+ **What V4.0.6 ships.** The Living Brain is written for the person who owns the memory, not for the person who built the ranker. It leads with how many questions your memory has actually answered instead of a raw event count, names its ranking phase in words, and refuses to present an untrained starting value as a measured result — where nothing has been measured yet, it says so and says what would change that. Alongside it, a readable consolidation layer: session, daily, and project summaries, each linked back to the memories it was derived from and each explicit about how much of the underlying data it could cover. Entity-level consolidation now actually runs during maintenance, merging repeated facts about the same entity and archiving the originals rather than deleting them. Codex and Bounded Loops are detected and shown among connected clients, labelled by the evidence that supports them — configuration proves setup, not traffic, and the dashboard says which one it has. Presence now distinguishes "no agents are active" from "presence has stopped being recorded", because those looked identical before and only one of them is fine. See [reviewed corrections](docs/reviewed-corrections.md) for the correction lifecycle and [MCP tools](docs/mcp-tools.md) for host-facing commands.
66
+
67
+ **Fixed in V4.0.6.** The knowledge graph no longer opens blank. It framed itself against a canvas that had no size yet, spent its whole frame budget drawing off-screen, and stopped — so the graph appeared only after you moved the node slider. Returning to the pane cleared the canvas without redrawing it, which failed the same way for a different reason. Both are fixed, the default node count is 50, and on narrower screens the details and chat panel is reachable instead of stranded a screen-height below the fold. Recall no longer raises when the reranker reports success but returns no scores; it falls back to its existing ranking. Corrections attempted without the daemon now refuse with the reason and the remedy, rather than reporting a transient error that could never clear.
68
+
69
+ **Carried forward from V4.0.5.** A correction is a review-gated lifecycle, not an in-place edit: SLM creates an immutable successor, keeps it out of current recall until an authenticated reviewer applies it, and preserves the predecessor for time-aware history. Every candidate path, including cached context, pins, bridge expansion, and scene expansion, uses hard current-truth admission and abstains if that truth cannot be read. `slm brain`, MCP, HTTP, and the Living Brain share one observation-only BrainTruth snapshot; feedback, external Bounded Loops evidence, and receipt claims are shown honestly but do not silently alter recall, ranking, or model routing. The optional Bounded Loops bridge remains capability-negotiated and independent.
70
+
71
+ **Adaptive-ranking migration.** V4.0.6 leaves the optional adaptive ranker off
72
+ unless an operator sets `SLM_RANKING` (`v1`, `v2`, or `v2-ensemble`). This does
73
+ not disable the normal retrieval channels; it prevents feedback and
74
+ observation data from changing ranking without an explicit operator decision.
66
75
 
67
76
  - **[SLM-Mesh](#slm-mesh-cross-session--cross-machine-coordination)** — authenticated cross-session and cross-machine peer coordination (messages, locks, shared state, inbox/outbox, optional discovery). Coordination only — not automatic replicated memory.
68
77
  - **Multi-scope memory & profiles** — workspaces (profiles) plus `personal` / `shared` / `global` scopes; cross-profile recall is default-deny.
@@ -71,7 +80,7 @@ SuperLocalMemory V4 combines conventional dense and lexical retrieval with graph
71
80
  - **Modes A / B / C** — local-only (A), on-device LLM enrichment (B), provider-assisted (C). An operating mode records technical locality facts; it does **not** determine EU AI Act legal compliance (that is deployment-context assessment — see [Privacy controls](#privacy-controls-and-operating-modes)).
72
81
  - **GDPR posture, retention & audit chain** — export, fail-closed cross-store erasure, retention policies, and a hash-chained audit trail. Engineering controls for compliance programs, not a legal certification.
73
82
  - **7-layer retrieval/recall stack & code graph** — multi-channel candidates (semantic, BM25, temporal, Hopfield, spreading activation) plus optional code-graph tools for blast radius and review context.
74
- - **MCP profiles** — `code` exposes **29** tools for installed coding agents; `full` **47**; `power` **59**; `whole` **92** (all registered). Also `core` (14), `mesh` (8), and the unrestricted default surface (47 with mesh enabled).
83
+ - **MCP profiles** — `code` exposes **31** tools for installed coding agents; `full` **49**; `power` **61**; `whole` **94** (all registered). Also `core` (16), `mesh` (8), and the unrestricted default surface (49 with mesh enabled).
75
84
  - **Governed write path & verifiable transactions** — admission + policy control, a per-owner obligation ledger, and a hash-sealed completion manifest with a reconciler that redrives unmet obligations.
76
85
  - **Self-healing lifecycle & admin remediation** — stale locks cleared on restart; list/resolve stuck operations from CLI, MCP, or the dashboard.
77
86
 
@@ -382,7 +391,7 @@ Full docs: [docs/multi-machine.md](docs/multi-machine.md) · [docs/distributed-d
382
391
  | **Python CLI + SDK** (primary) | Activate a Python virtual environment, then `python -m pip install superlocalmemory` | Python 3.11+; the `slm` CLI and importable SDK stay inside that environment |
383
392
  | **Repository clone — macOS/Linux** | `./scripts/install.sh install` | Research/contributor path; delegates to an existing uv or pipx installation |
384
393
  | **Repository clone — Windows** | `.\scripts\install.ps1 -Action Install` | Research/contributor path; delegates to an existing uv or pipx installation |
385
- | **Claude Code Plugin** (WP-06) | `/plugin marketplace add qualixar/superlocalmemory` then `/plugin install superlocalmemory@qualixar` | Self-bootstraps venv, isolated SLM_DATA_DIR, additive — 14-tool core. Ships the skills/agents/hooks/commands |
394
+ | **Claude Code Plugin** (WP-06) | `/plugin marketplace add qualixar/superlocalmemory` then `/plugin install superlocalmemory@qualixar` | Self-bootstraps venv, isolated SLM_DATA_DIR, additive — 16-tool core. Ships the skills/agents/hooks/commands |
386
395
  | **Portable / IDE connect** (WP-08) | `slm connect <ide> [--here]` | Wire any IDE without reinstalling; `slm connect claude-code` → plugin pointer |
387
396
 
388
397
  After any install path: `slm setup` → `slm doctor` → `slm warmup` (optional, pre-downloads ~500MB embedding model).
@@ -435,12 +444,12 @@ Control tool surface via `SLM_MCP_PROFILE`:
435
444
 
436
445
  | Profile | Tools | Use case |
437
446
  |:--------|:-----:|:---------|
438
- | `core` | 14 | Memory, session, and optimize core |
439
- | `code` | 29 | Core + portable Brain evidence + code-graph tools + profile switching + bounded loops |
447
+ | `core` | 16 | Memory, session, optimize, and correction review |
448
+ | `code` | 31 | Core + portable Brain evidence + code-graph tools + profile switching + bounded loops |
440
449
  | `mesh` | 8 | SLM-Mesh only — multi-session / multi-machine coordination |
441
- | `full` | 47 | Memory + portable Brain evidence + optimize + evolution + mesh + bounded loops |
442
- | `power` | 59 | Full + administration, lifecycle, and diagnostics |
443
- | `whole` | 92 | Every registered MCP tool |
450
+ | `full` | 49 | Memory + portable Brain evidence + optimize + evolution + mesh + bounded loops |
451
+ | `power` | 61 | Full + administration, lifecycle, and diagnostics |
452
+ | `whole` | 94 | Every registered MCP tool |
444
453
 
445
454
  **Precedence:** `ALL` > `TOOLS` > `PROFILE` > `default`
446
455
 
@@ -451,7 +460,7 @@ slm mcp
451
460
 
452
461
  For a predictable small surface, set `core` explicitly. Leaving the variable
453
462
  unset retains the compatibility default, whose mesh tools follow the local
454
- mesh setting. Count-suffixed aliases remain for backward compatibility and emit a migration warning: `core14`, `code20`, `code21`, `code24`, `code28`, `code29`, `mesh8`, `full38`, `full39`, `full42`, `full46`, `full47`, `power50`, `power51`, `power54`, `power58`, `power59`, `whole81`, `whole84`, `whole91`, `whole92`. Unknown names stop startup instead of silently selecting another tool set.
463
+ mesh setting. Count-suffixed aliases remain for backward compatibility and emit a migration warning: `core14`, `core16`, `code20`, `code21`, `code24`, `code28`, `code29`, `code31`, `mesh8`, `full38`, `full39`, `full42`, `full46`, `full47`, `full49`, `power50`, `power51`, `power54`, `power58`, `power59`, `power61`, `whole81`, `whole84`, `whole91`, `whole92`, `whole94`. Unknown names stop startup instead of silently selecting another tool set.
455
464
 
456
465
  Per-IDE configs available for Claude Code, Cursor, Windsurf, VS Code Copilot, Continue, Gemini CLI, JetBrains, Zed, and more (15 configs in `ide/configs/`). See [docs/ide-setup.md](docs/ide-setup.md).
457
466
 
@@ -473,7 +482,7 @@ then install:
473
482
  ```
474
483
 
475
484
  - Self-bootstraps a Python venv, installs all deps in an isolated `SLM_DATA_DIR`
476
- - Registers the 14-tool core MCP surface (`core14` profile by default)
485
+ - Registers the 16-tool core MCP surface (`core16` profile by default; `core14` remains a compatibility alias)
477
486
  - Ships the SLM skills / agents / hooks / commands / rules
478
487
  - Additive — does not replace an existing SLM install
479
488
  - `slm connect claude-code` detects an existing plugin install and links them
@@ -1,4 +1,4 @@
1
- # SuperLocalMemory V3 - Codex CLI MCP Configuration
1
+ # SuperLocalMemory V4.0.5 - Codex CLI MCP Configuration
2
2
  # Copyright (c) 2026 Varun Pratap Bhardwaj
3
3
  # Licensed under AGPL-3.0-or-later
4
4
  #
@@ -8,4 +8,4 @@
8
8
  [mcp_servers.superlocalmemory]
9
9
  command = "slm"
10
10
  args = ["mcp"]
11
-
11
+ env = { SLM_MCP_PROFILE = "code", SLM_AGENT_ID = "codex" }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "superlocalmemory",
3
- "version": "4.0.4",
3
+ "version": "4.0.6",
4
4
  "description": "Local-first agent memory with MCP and an agent-native CLI. Documented clients include Claude Code, Cursor, and Windsurf.",
5
5
  "keywords": [
6
6
  "ai-memory",
@@ -70,6 +70,8 @@
70
70
  "!src/**/__pycache__/",
71
71
  "!src/**/*.pyc",
72
72
  "!src/**/*.pyo",
73
+ "!src/superlocalmemory/graphify-out/",
74
+ "!src/**/graphify-out/**",
73
75
  "ide/completions/",
74
76
  "ide/configs/",
75
77
  "ide/hooks/",
@@ -15,5 +15,5 @@
15
15
  "mcpServers": "./.mcp.json",
16
16
  "name": "superlocalmemory",
17
17
  "repository": "https://github.com/qualixar/superlocalmemory",
18
- "version": "4.0.4"
18
+ "version": "4.0.5"
19
19
  }
package/plugin/.mcp.json CHANGED
@@ -5,6 +5,7 @@
5
5
  "args": [],
6
6
  "env": {
7
7
  "SLM_MCP_PROFILE": "code",
8
+ "SLM_AGENT_ID": "claude_code",
8
9
  "SLM_DATA_DIR": "${CLAUDE_PLUGIN_DATA}"
9
10
  }
10
11
  }
package/plugin/CLAUDE.md CHANGED
@@ -1,4 +1,4 @@
1
- <!-- BEGIN SuperLocalMemory v4.0.4 -->
1
+ <!-- BEGIN SuperLocalMemory v4.0.5 -->
2
2
 
3
3
  ## SuperLocalMemory (SLM) — Agent Rules
4
4
 
@@ -39,6 +39,6 @@ slm-recall · slm-remember · slm-session · slm-status · slm-cache · slm-comp
39
39
  ### Subagents
40
40
  slm-memory-advisor (memory decisions, session hygiene, scope/profile guidance) · slm-optimize-advisor (context compression + KV cache) · slm-governance-advisor (scope/roles/compliance/GDPR)
41
41
 
42
- <!-- END SuperLocalMemory v4.0.4 -->
42
+ <!-- END SuperLocalMemory v4.0.5 -->
43
43
 
44
- SuperLocalMemory v4.0.4 · Qualixar · AGPL-3.0-or-later
44
+ SuperLocalMemory v4.0.5 · Qualixar · AGPL-3.0-or-later
@@ -77,4 +77,4 @@ slm-scope · slm-governance · slm-profile · slm-remember · slm-recall
77
77
  # What NOT to do
78
78
  Never session_init twice; never forget without dry-run preview; never store secrets; never bypass role checks; never claim an erasure succeeded without verifying via recall.
79
79
 
80
- SuperLocalMemory v4.0.4 · Qualixar · AGPL-3.0-or-later
80
+ SuperLocalMemory v4.0.5 · Qualixar · AGPL-3.0-or-later
@@ -68,4 +68,4 @@ assessment. The gate is the authority.
68
68
 
69
69
  ---
70
70
 
71
- SuperLocalMemory v4.0.4 · Qualixar · AGPL-3.0-or-later
71
+ SuperLocalMemory v4.0.5 · Qualixar · AGPL-3.0-or-later
@@ -46,4 +46,4 @@ slm-recall · slm-remember · slm-session · slm-scope · slm-profile · slm-gov
46
46
  # What NOT to do
47
47
  Never session_init twice; never forget dry_run=False without reporting preview; never dump a whole file into remember; never invent a memory; never claim "saved" without success:true / clean CLI exit; never bypass scope or governance restrictions.
48
48
 
49
- SuperLocalMemory v4.0.4 · Qualixar · AGPL-3.0-or-later
49
+ SuperLocalMemory v4.0.5 · Qualixar · AGPL-3.0-or-later
@@ -41,4 +41,4 @@ slm-compress · slm-cache · slm-status · slm-profile
41
41
  # What NOT to do
42
42
  Never compress code-for-edit/JSON-to-parse/<500 chars; never store secrets/ccr_ids; never let optimize failure block/alter the task; never claim a specific savings %; never carry ccr_ids across profile switches.
43
43
 
44
- SuperLocalMemory v4.0.4 · Qualixar · AGPL-3.0-or-later
44
+ SuperLocalMemory v4.0.5 · Qualixar · AGPL-3.0-or-later
@@ -1 +1 @@
1
- superlocalmemory==4.0.4
1
+ superlocalmemory==4.0.5
@@ -145,4 +145,4 @@ These subcommands control daemon-level cache settings. They do not read or write
145
145
 
146
146
  ---
147
147
 
148
- SuperLocalMemory v4.0.4 · Qualixar · AGPL-3.0-or-later
148
+ SuperLocalMemory v4.0.5 · Qualixar · AGPL-3.0-or-later
@@ -147,4 +147,4 @@ Content over 1 MB (1 000 000 bytes UTF-8) is processed but `reversible` is force
147
147
 
148
148
  ---
149
149
 
150
- SuperLocalMemory v4.0.4 · Qualixar · AGPL-3.0-or-later
150
+ SuperLocalMemory v4.0.5 · Qualixar · AGPL-3.0-or-later
@@ -245,4 +245,4 @@ Before running any destructive operation (`forget`, `compact_memories`):
245
245
 
246
246
  ---
247
247
 
248
- *SuperLocalMemory v4.0.4 · Qualixar · AGPL-3.0-or-later*
248
+ *SuperLocalMemory v4.0.5 · Qualixar · AGPL-3.0-or-later*
@@ -290,7 +290,8 @@ This skill uses graph tools that are only active under the `code` MCP profile
290
290
 
291
291
  ```json
292
292
  "env": {
293
- "SLM_MCP_PROFILE": "code"
293
+ "SLM_MCP_PROFILE": "code",
294
+ "SLM_AGENT_ID": "claude_code"
294
295
  }
295
296
  ```
296
297
 
@@ -311,4 +312,4 @@ profile. See `slm-profile` for the full profile switching workflow.
311
312
 
312
313
  ---
313
314
 
314
- SuperLocalMemory v4.0.4 · Qualixar · AGPL-3.0-or-later
315
+ SuperLocalMemory v4.0.5 · Qualixar · AGPL-3.0-or-later
@@ -96,4 +96,4 @@ paused, name the approval needed; when errored, quote the short detail.
96
96
 
97
97
  ---
98
98
 
99
- SuperLocalMemory v4.0.4 · Qualixar · AGPL-3.0-or-later
99
+ SuperLocalMemory v4.0.5 · Qualixar · AGPL-3.0-or-later
@@ -279,4 +279,4 @@ mesh availability.
279
279
 
280
280
  ---
281
281
 
282
- *SuperLocalMemory v4.0.4 · Qualixar · AGPL-3.0-or-later*
282
+ *SuperLocalMemory v4.0.5 · Qualixar · AGPL-3.0-or-later*
@@ -104,6 +104,7 @@ In your `.mcp.json` (Claude Code) or `.codex/config.toml` (Codex):
104
104
  ```json
105
105
  "env": {
106
106
  "SLM_MCP_PROFILE": "code",
107
+ "SLM_AGENT_ID": "claude_code",
107
108
  "SLM_DATA_DIR": "~/.superlocalmemory"
108
109
  }
109
110
  ```
@@ -145,4 +146,4 @@ Name them differently in your MCP config (e.g. `superlocalmemory-personal` and
145
146
 
146
147
  ---
147
148
 
148
- *SuperLocalMemory v4.0.4 · Qualixar · AGPL-3.0-or-later*
149
+ *SuperLocalMemory v4.0.5 · Qualixar · AGPL-3.0-or-later*
@@ -236,4 +236,4 @@ before recalling, then switch back. See `slm-profile` for workspace switching.
236
236
 
237
237
  ---
238
238
 
239
- *SuperLocalMemory v4.0.4 · Qualixar · AGPL-3.0-or-later*
239
+ *SuperLocalMemory v4.0.5 · Qualixar · AGPL-3.0-or-later*
@@ -238,4 +238,4 @@ different workspace, use `switch_profile` first. See `slm-profile`.
238
238
 
239
239
  ---
240
240
 
241
- *SuperLocalMemory v4.0.4 · Qualixar · AGPL-3.0-or-later*
241
+ *SuperLocalMemory v4.0.5 · Qualixar · AGPL-3.0-or-later*
@@ -173,4 +173,4 @@ to review the impact. See `slm-remember` for the full deletion discipline.
173
173
 
174
174
  ---
175
175
 
176
- *SuperLocalMemory v4.0.4 · Qualixar · AGPL-3.0-or-later*
176
+ *SuperLocalMemory v4.0.5 · Qualixar · AGPL-3.0-or-later*
@@ -227,4 +227,4 @@ explicitly and call `recall` with `include_global`/`include_shared` after
227
227
 
228
228
  ---
229
229
 
230
- *SuperLocalMemory v4.0.4 · Qualixar · AGPL-3.0-or-later*
230
+ *SuperLocalMemory v4.0.5 · Qualixar · AGPL-3.0-or-later*
@@ -163,4 +163,4 @@ multi-profile setup. To switch the active profile, see `slm-profile`.
163
163
 
164
164
  ---
165
165
 
166
- SuperLocalMemory v4.0.4 · Qualixar · AGPL-3.0-or-later
166
+ SuperLocalMemory v4.0.5 · Qualixar · AGPL-3.0-or-later
@@ -80,12 +80,13 @@ When the SLM MCP server is unavailable, use these CLI equivalents:
80
80
 
81
81
  ---
82
82
 
83
- ## Tool reference (core profile — 14 tools)
83
+ ## Tool reference (core profile — 16 tools)
84
84
 
85
- > The MCP config ships `SLM_MCP_PROFILE=code` (29 tools): the 14 core memory tools below
86
- > **plus** 6 code-graph tools (`build_code_graph`, `get_blast_radius`, `query_graph`,
87
- > `semantic_search_code`, `get_review_context`, `detect_changes`) and `switch_profile`.
88
- > Use `full` (47 tools) to add mesh coordination. Use `power` (59 tools) for governance
85
+ > The MCP config ships `SLM_MCP_PROFILE=code` and `SLM_AGENT_ID=claude_code` (31 tools):
86
+ > the 16 core memory and correction-review tools below **plus** 6 code-graph tools
87
+ > (`build_code_graph`, `get_blast_radius`, `query_graph`, `semantic_search_code`,
88
+ > `get_review_context`, `detect_changes`) and `switch_profile`.
89
+ > Use `full` (49 tools) to add mesh coordination. Use `power` (61 tools) for governance
89
90
  > and audit tools. See slm-profile for profile switching.
90
91
 
91
92
  | Tool | Signature (key params) | Notes |
@@ -290,7 +290,8 @@ This skill uses graph tools that are only active under the `code` MCP profile
290
290
 
291
291
  ```json
292
292
  "env": {
293
- "SLM_MCP_PROFILE": "code"
293
+ "SLM_MCP_PROFILE": "code",
294
+ "SLM_AGENT_ID": "claude_code"
294
295
  }
295
296
  ```
296
297
 
@@ -104,6 +104,7 @@ In your `.mcp.json` (Claude Code) or `.codex/config.toml` (Codex):
104
104
  ```json
105
105
  "env": {
106
106
  "SLM_MCP_PROFILE": "code",
107
+ "SLM_AGENT_ID": "claude_code",
107
108
  "SLM_DATA_DIR": "~/.superlocalmemory"
108
109
  }
109
110
  ```
package/pyproject.toml CHANGED
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "superlocalmemory"
3
- version = "4.0.4"
3
+ version = "4.0.6"
4
4
  description = "Local-first agent memory with auditable hybrid retrieval"
5
5
  readme = "README.md"
6
6
  license = "AGPL-3.0-or-later"
@@ -32,7 +32,7 @@ if "OMP_NUM_THREADS" not in os.environ:
32
32
  os.environ["OMP_NUM_THREADS"] = "2"
33
33
  # ---------------------------------------------------------------------------
34
34
 
35
- __version__ = "4.0.4"
35
+ __version__ = "4.0.6"
36
36
 
37
37
  _REQUIRED_VERSIONS = {
38
38
  "sentence_transformers": "5.3.0",
@@ -453,6 +453,112 @@ class RbacEngine:
453
453
  def set_require_login(self, enabled: bool) -> None:
454
454
  self.set_policy("require_login", "1" if enabled else "0")
455
455
 
456
+ # -- correction review policy -----------------------------------------
457
+
458
+ # Key prefix used in rbac_settings. One entry per profile_id.
459
+ _CORRECTION_POLICY_PREFIX = "correction_review_policy:"
460
+
461
+ def set_correction_review_policy(
462
+ self,
463
+ profile_id: str,
464
+ policy: dict,
465
+ *,
466
+ authorizer_user_id: str,
467
+ ) -> dict:
468
+ """Attach a correction-case review policy for ``profile_id``.
469
+
470
+ Authorization rules
471
+ -------------------
472
+ * PERSONAL install (no users yet / user_count == 0): the machine
473
+ owner is the implicit admin and may attach a policy without a
474
+ role check. This matches the additive / self-hosting-correct
475
+ principle in the RBAC design.
476
+ * TEAM / ENTERPRISE install (user_count > 0): the authorizer MUST
477
+ hold Role.ADMIN for the target profile. Any other role raises
478
+ RbacError. This prevents a MEMBER or VIEWER from escalating their
479
+ own correction authority.
480
+
481
+ Governance invariants (CRIT-hardened)
482
+ --------------------------------------
483
+ C1 Non-admins cannot attach a policy (role check above).
484
+ C2 ``automatic_application`` is never silently promoted to True.
485
+ The field defaults to False; an authorizer must set it
486
+ explicitly, and it is recorded with the authorizer's user_id and
487
+ a timestamp so the action is auditable.
488
+ C3 Personal installs do NOT auto-create a policy. The machine
489
+ owner must call this method explicitly. Until they do,
490
+ ``get_correction_review_policy`` returns None and BrainTruth
491
+ reports the policy as not_configured.
492
+
493
+ Returns the stored policy dict.
494
+ """
495
+ import json as _json
496
+
497
+ if not profile_id:
498
+ raise RbacError("profile_id must be non-empty.")
499
+ if not authorizer_user_id:
500
+ raise RbacError("authorizer_user_id must be non-empty.")
501
+
502
+ # CRIT-C1: enforce admin role in multi-user (team/enterprise) mode.
503
+ # In personal mode (zero registered users) the machine owner is the
504
+ # implicit admin — deny-by-default still applies to defined users.
505
+ user_count = self.user_count()
506
+ if user_count > 0:
507
+ role = self.get_role(authorizer_user_id, profile_id)
508
+ if role != Role.ADMIN:
509
+ raise RbacError(
510
+ f"Attaching a correction review policy requires Role.ADMIN. "
511
+ f"User '{authorizer_user_id}' has role={role!r} on "
512
+ f"profile '{profile_id}'."
513
+ )
514
+
515
+ # CRIT-C2: automatic_application is never silently set to True.
516
+ # The authorizer must explicitly include it in the policy dict;
517
+ # it is still coerced to bool so a truthy non-bool value doesn't slip through.
518
+ auto_apply = bool(policy.get("automatic_application", False))
519
+
520
+ safe_policy = {
521
+ "policy_id": str(policy.get("policy_id") or _uid()),
522
+ "authorized_by": authorizer_user_id,
523
+ "authorized_at": _now(),
524
+ "automatic_application": auto_apply,
525
+ "enabled": bool(policy.get("enabled", True)),
526
+ "applies_to_profile": str(policy.get("applies_to_profile", profile_id)),
527
+ }
528
+ key = f"{self._CORRECTION_POLICY_PREFIX}{profile_id}"
529
+ self.set_policy(key, _json.dumps(safe_policy))
530
+ logger.info(
531
+ "RBAC: correction review policy attached for profile '%s' by '%s' "
532
+ "(automatic_application=%s)",
533
+ profile_id, authorizer_user_id, auto_apply,
534
+ )
535
+ return safe_policy
536
+
537
+ def get_correction_review_policy(self, profile_id: str) -> dict | None:
538
+ """Return the attached correction review policy for ``profile_id``.
539
+
540
+ Returns None when no policy has been attached. The caller (host
541
+ integration) should pass this to
542
+ ``BrainTruthService(review_policy=...)``.
543
+
544
+ This method is safe to call in personal mode (no users configured).
545
+ """
546
+ import json as _json
547
+
548
+ key = f"{self._CORRECTION_POLICY_PREFIX}{profile_id}"
549
+ raw = self.get_policy(key)
550
+ if not raw:
551
+ return None
552
+ try:
553
+ return _json.loads(raw)
554
+ except (ValueError, TypeError):
555
+ logger.warning(
556
+ "RBAC: malformed correction review policy for profile '%s' — "
557
+ "returning None (treat as not_configured)",
558
+ profile_id,
559
+ )
560
+ return None
561
+
456
562
  # -- authorization ----------------------------------------------------
457
563
 
458
564
  def has_permission(self, user_id: str, profile_id: str,
@@ -0,0 +1,5 @@
1
+ """Read-only, transport-neutral views of SuperLocalMemory's brain state."""
2
+
3
+ from superlocalmemory.brain.truth import BRAIN_TRUTH_V1, BrainTruthService
4
+
5
+ __all__ = ("BRAIN_TRUTH_V1", "BrainTruthService")