superlocalmemory 4.0.2 → 4.0.3

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 (45) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/README.md +35 -40
  3. package/package.json +1 -1
  4. package/plugin/.claude-plugin/plugin.json +1 -1
  5. package/plugin/CLAUDE.md +3 -3
  6. package/plugin/agents/slm-governance-advisor.md +1 -1
  7. package/plugin/agents/slm-loop-runner.md +1 -1
  8. package/plugin/agents/slm-memory-advisor.md +1 -1
  9. package/plugin/agents/slm-optimize-advisor.md +1 -1
  10. package/plugin/requirements.txt +1 -1
  11. package/plugin/skills/slm-cache/SKILL.md +1 -1
  12. package/plugin/skills/slm-compress/SKILL.md +1 -1
  13. package/plugin/skills/slm-governance/SKILL.md +1 -1
  14. package/plugin/skills/slm-graph/SKILL.md +1 -1
  15. package/plugin/skills/slm-loop/SKILL.md +1 -1
  16. package/plugin/skills/slm-mesh/SKILL.md +1 -1
  17. package/plugin/skills/slm-profile/SKILL.md +4 -4
  18. package/plugin/skills/slm-recall/SKILL.md +1 -1
  19. package/plugin/skills/slm-remember/SKILL.md +1 -1
  20. package/plugin/skills/slm-scope/SKILL.md +1 -1
  21. package/plugin/skills/slm-session/SKILL.md +1 -1
  22. package/plugin/skills/slm-status/SKILL.md +1 -1
  23. package/plugin-src/rules/AGENTS.md +3 -3
  24. package/plugin-src/skills/slm-cache/SKILL.md +1 -1
  25. package/plugin-src/skills/slm-compress/SKILL.md +1 -1
  26. package/plugin-src/skills/slm-governance/SKILL.md +1 -1
  27. package/plugin-src/skills/slm-graph/SKILL.md +1 -1
  28. package/plugin-src/skills/slm-loop/SKILL.md +1 -1
  29. package/plugin-src/skills/slm-mesh/SKILL.md +1 -1
  30. package/plugin-src/skills/slm-profile/SKILL.md +4 -4
  31. package/plugin-src/skills/slm-recall/SKILL.md +1 -1
  32. package/plugin-src/skills/slm-remember/SKILL.md +1 -1
  33. package/plugin-src/skills/slm-scope/SKILL.md +1 -1
  34. package/plugin-src/skills/slm-session/SKILL.md +1 -1
  35. package/plugin-src/skills/slm-status/SKILL.md +1 -1
  36. package/pyproject.toml +1 -1
  37. package/scripts/postinstall-interactive.js +1 -0
  38. package/scripts/postinstall.js +4 -0
  39. package/src/superlocalmemory/__init__.py +1 -1
  40. package/src/superlocalmemory/cli/commands.py +10 -19
  41. package/src/superlocalmemory/cli/host_upgrades.py +175 -0
  42. package/src/superlocalmemory/cli/main.py +29 -4
  43. package/src/superlocalmemory/mcp/profiles.py +21 -12
  44. package/src/superlocalmemory/mcp/server.py +4 -6
  45. package/src/superlocalmemory/ui/js/od-mcp.js +6 -6
package/CHANGELOG.md CHANGED
@@ -5,6 +5,32 @@ 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.3] - 2026-08-15 — Consented host integration upgrades
9
+
10
+ ### Added
11
+ - `slm upgrade-hosts` provides a read-only preview of existing SLM host
12
+ integrations. `--apply` requires either explicit `--host` targets or
13
+ `--all-detected`; unbounded host mutation is rejected.
14
+ - The npm runtime installer and interactive setup checklist direct existing
15
+ users to the upgrade preview. README, source docs, and Wiki source document
16
+ the host-specific upgrade and restart path.
17
+ - Portable Brain evidence is now reachable from the `code`, `full`, and
18
+ `power` MCP profiles used by installed agents. Profile counts are now code
19
+ 28, full 46, power 58, and whole 91; legacy count-suffixed aliases remain
20
+ supported.
21
+ - The separately packaged Codex rules and skills are synchronized from the
22
+ shared plugin source for this release.
23
+
24
+ ### Changed
25
+ - Existing portable MCP blocks are verified and preserved, retaining their
26
+ host-specific command paths, environment variables, and unrelated servers.
27
+ Codex refreshes only SLM-owned skills, agents, and lifecycle hooks.
28
+ - Claude Code plugin updates remain owned by its native plugin manager.
29
+
30
+ ### Safety
31
+ - Normal CLI commands and MCP startup no longer auto-install or update Claude
32
+ Code hooks. Host configuration changes require explicit operator action.
33
+
8
34
  ## [4.0.2] - 2026-08-15 — Portable Living Brain evidence
9
35
 
10
36
  ### Added
package/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  </picture>
6
6
  </p>
7
7
 
8
- <h1 align="center">SuperLocalMemory V4.0.2</h1>
8
+ <h1 align="center">SuperLocalMemory V4.0.3</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.2</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.3</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.2-Current_Release-2ea44f?style=for-the-badge&logo=checkmarx&logoColor=white" alt="v4.0.2 — Current Release"/></a>
35
+ <a href="CHANGELOG.md"><img src="https://img.shields.io/badge/v4.0.3-Current_Release-2ea44f?style=for-the-badge&logo=checkmarx&logoColor=white" alt="v4.0.3 — 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>
@@ -62,7 +62,7 @@ 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.2 ships.** V4 is 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.3 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 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:
66
66
 
67
67
  - **[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
68
  - **Multi-scope memory & profiles** — workspaces (profiles) plus `personal` / `shared` / `global` scopes; cross-profile recall is default-deny.
@@ -71,7 +71,7 @@ SuperLocalMemory V4 combines conventional dense and lexical retrieval with graph
71
71
  - **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
72
  - **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
73
  - **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** — `full` exposes **42** tools (default everyday surface); `power` **54**; `whole` **87** (all registered). Also `core` (14), `code` (24), and `mesh` (8).
74
+ - **MCP profiles** — `code` exposes **28** tools for installed coding agents; `full` **46**; `power` **58**; `whole` **91** (all registered). Also `core` (14), `mesh` (8), and the unrestricted default surface (46 with mesh enabled).
75
75
  - **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
76
  - **Self-healing lifecycle & admin remediation** — stale locks cleared on restart; list/resolve stuck operations from CLI, MCP, or the dashboard.
77
77
 
@@ -387,6 +387,22 @@ Full docs: [docs/multi-machine.md](docs/multi-machine.md) · [docs/distributed-d
387
387
 
388
388
  After any install path: `slm setup` → `slm doctor` → `slm warmup` (optional, pre-downloads ~500MB embedding model).
389
389
 
390
+ ### Upgrading an existing installation
391
+
392
+ An npm, pip, or repository update upgrades the SLM runtime; it does not silently
393
+ rewrite your IDE configuration, hooks, or plugin state. Review the existing
394
+ integrations first:
395
+
396
+ ```bash
397
+ slm upgrade-hosts
398
+ ```
399
+
400
+ Then explicitly apply the hosts you approve, for example
401
+ `slm upgrade-hosts --host codex --apply`, or use
402
+ `slm upgrade-hosts --all-detected --apply` after reviewing the preview. See
403
+ [Host Integration Upgrades](docs/host-upgrades.md) for the full safety contract
404
+ and the Claude Code plugin update path.
405
+
390
406
  | Component | Size | When |
391
407
  |:----------|:-----|:-----|
392
408
  | Core libraries (numpy, scipy, networkx) | ~50MB | During install |
@@ -420,11 +436,11 @@ Control tool surface via `SLM_MCP_PROFILE`:
420
436
  | Profile | Tools | Use case |
421
437
  |:--------|:-----:|:---------|
422
438
  | `core` | 14 | Memory, session, and optimize core |
423
- | `code` | 24 | Core + code-graph tools + profile switching + bounded loops |
439
+ | `code` | 28 | Core + portable Brain evidence + code-graph tools + profile switching + bounded loops |
424
440
  | `mesh` | 8 | SLM-Mesh only — multi-session / multi-machine coordination |
425
- | `full` | 42 | Memory + optimize + evolution + mesh + bounded loops |
426
- | `power` | 54 | Full + administration, lifecycle, and diagnostics |
427
- | `whole` | 87 | Every registered MCP tool |
441
+ | `full` | 46 | Memory + portable Brain evidence + optimize + evolution + mesh + bounded loops |
442
+ | `power` | 58 | Full + administration, lifecycle, and diagnostics |
443
+ | `whole` | 91 | Every registered MCP tool |
428
444
 
429
445
  **Precedence:** `ALL` > `TOOLS` > `PROFILE` > `default`
430
446
 
@@ -435,7 +451,7 @@ slm mcp
435
451
 
436
452
  For a predictable small surface, set `core` explicitly. Leaving the variable
437
453
  unset retains the compatibility default, whose mesh tools follow the local
438
- mesh setting. Count-suffixed aliases remain for backward compatibility and emit a migration warning: `core14`, `code20`, `code21`, `code24`, `mesh8`, `full38`, `full39`, `full42`, `power50`, `power51`, `power54`, `whole81`, `whole84`. Unknown names stop startup instead of silently selecting another tool set.
454
+ mesh setting. Count-suffixed aliases remain for backward compatibility and emit a migration warning: `core14`, `code20`, `code21`, `code24`, `code28`, `mesh8`, `full38`, `full39`, `full42`, `full46`, `power50`, `power51`, `power54`, `power58`, `whole81`, `whole84`, `whole91`. Unknown names stop startup instead of silently selecting another tool set.
439
455
 
440
456
  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).
441
457
 
@@ -647,25 +663,12 @@ Multi-Agent Memory workspace.
647
663
 
648
664
  ## Framework Adapters (V4)
649
665
 
650
- SLM ships nine framework adapters under `ide/integrations/`. Each adapter
651
- wires SLM as the memory and history provider for the respective framework
652
- without replacing the framework's own agent runtime.
653
-
654
- | Framework | Directory |
655
- |-----------|-----------|
656
- | LangGraph | `ide/integrations/langgraph/` |
657
- | Semantic Kernel | `ide/integrations/semantic-kernel/` |
658
- | Microsoft Agent Framework | `ide/integrations/agent-framework/` |
659
- | LangChain | `ide/integrations/langchain/` |
660
- | LlamaIndex | `ide/integrations/llamaindex/` |
661
- | CrewAI | `ide/integrations/crewai/` |
662
- | AutoGen | `ide/integrations/autogen/` |
663
- | Google ADK | `ide/integrations/google-adk/` |
664
- | OpenAI Agents | `ide/integrations/openai-agents/` |
665
-
666
- Pydantic AI is not included — it does not expose a formal memory interface for
667
- external providers. Each adapter's `README.md` covers installation and
668
- configuration for that framework.
666
+ SLM ships nine adapters under `ide/integrations/`: LangGraph, Semantic Kernel,
667
+ Microsoft Agent Framework, LangChain, LlamaIndex, CrewAI, AutoGen, Google ADK,
668
+ and OpenAI Agents. Each wires SLM as memory and history without replacing the
669
+ framework runtime; its directory contains installation/configuration guidance.
670
+ Pydantic AI is not included because it does not expose a formal external-memory
671
+ interface.
669
672
 
670
673
  ---
671
674
 
@@ -697,21 +700,13 @@ runtime capability is enabled and healthy. See [CHANGELOG.md](CHANGELOG.md) for
697
700
  the complete release history.
698
701
  ## Research Papers
699
702
 
700
- SuperLocalMemory has a V4 arXiv preprint with a companion Zenodo archive, plus three earlier arXiv preprints (2026):
701
-
702
- - **SuperLocalMemory 4.0: The Governed Memory Operating System for AI Agents:** [arXiv:2608.08253](https://arxiv.org/abs/2608.08253) · [Zenodo 21853302](https://zenodo.org/records/21853302) · [DOI 10.5281/zenodo.21853302](https://doi.org/10.5281/zenodo.21853302).
703
- - **The Living Brain (V3.3):** [arXiv:2604.04514](https://arxiv.org/abs/2604.04514) · [Zenodo 19435120](https://zenodo.org/records/19435120)
704
- - **Information-Geometric Foundations (V3):** [arXiv:2603.14588](https://arxiv.org/abs/2603.14588) · [Zenodo 19038659](https://zenodo.org/records/19038659)
705
- - **Trust & Behavioral Foundations (V2):** [arXiv:2603.02240](https://arxiv.org/abs/2603.02240) · [Zenodo 18709670](https://zenodo.org/records/18709670)
703
+ SuperLocalMemory has a V4 [arXiv preprint](https://arxiv.org/abs/2608.08253) with [Zenodo archive](https://zenodo.org/records/21853302) and [DOI](https://doi.org/10.5281/zenodo.21853302), plus [The Living Brain (V3.3)](https://arxiv.org/abs/2604.04514), [Information-Geometric Foundations (V3)](https://arxiv.org/abs/2603.14588), and [Trust & Behavioral Foundations (V2)](https://arxiv.org/abs/2603.02240).
706
704
 
707
705
  Use the citation metadata on the linked arXiv or Zenodo records.
708
706
 
709
707
  ## Support / License / Qualixar
710
- See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines, the [Wiki](https://github.com/qualixar/superlocalmemory/wiki) for detailed documentation, and [LICENSE](LICENSE) for the GNU Affero General Public License v3.0 (AGPL-3.0).
711
- For commercial licensing (closed-source, proprietary, or hosted use), see [COMMERCIAL-LICENSE.md](COMMERCIAL-LICENSE.md) or contact varun.pratap.bhardwaj@gmail.com.
712
- Copyright (c) 2026 Varun Pratap Bhardwaj / Qualixar · Part of [Qualixar](https://qualixar.com) · Author: [Varun Pratap Bhardwaj](https://varunpratap.com)
713
- Acknowledgments: [Everything Claude Code](https://github.com/affaan-m/everything-claude-code) informed skill observation; [HKUDS/OpenSpace](https://github.com/HKUDS/OpenSpace) informed skill-evolution verification.
714
- Qualixar builds open-source infrastructure for AI reliability engineering. Start at [qualixar.com](https://qualixar.com) or browse the [research archive](https://huggingface.co/Qualixar).
708
+ See [CONTRIBUTING.md](CONTRIBUTING.md), the [Wiki](https://github.com/qualixar/superlocalmemory/wiki), and [LICENSE](LICENSE) (AGPL-3.0). For commercial licensing, see [COMMERCIAL-LICENSE.md](COMMERCIAL-LICENSE.md) or contact varun.pratap.bhardwaj@gmail.com.
709
+ Copyright (c) 2026 Varun Pratap Bhardwaj / Qualixar · [Qualixar](https://qualixar.com) · [research archive](https://huggingface.co/Qualixar). Acknowledgments: [Everything Claude Code](https://github.com/affaan-m/everything-claude-code) informed skill observation; [HKUDS/OpenSpace](https://github.com/HKUDS/OpenSpace) informed skill-evolution verification.
715
710
 
716
711
  ## Star This Project
717
712
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "superlocalmemory",
3
- "version": "4.0.2",
3
+ "version": "4.0.3",
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",
@@ -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.2"
18
+ "version": "4.0.3"
19
19
  }
package/plugin/CLAUDE.md CHANGED
@@ -1,4 +1,4 @@
1
- <!-- BEGIN SuperLocalMemory v4.0.2 -->
1
+ <!-- BEGIN SuperLocalMemory v4.0.3 -->
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.2 -->
42
+ <!-- END SuperLocalMemory v4.0.3 -->
43
43
 
44
- SuperLocalMemory v4.0.2 · Qualixar · AGPL-3.0-or-later
44
+ SuperLocalMemory v4.0.3 · 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.2 · Qualixar · AGPL-3.0-or-later
80
+ SuperLocalMemory v4.0.3 · 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.2 · Qualixar · AGPL-3.0-or-later
71
+ SuperLocalMemory v4.0.3 · 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.2 · Qualixar · AGPL-3.0-or-later
49
+ SuperLocalMemory v4.0.3 · 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.2 · Qualixar · AGPL-3.0-or-later
44
+ SuperLocalMemory v4.0.3 · Qualixar · AGPL-3.0-or-later
@@ -1 +1 @@
1
- superlocalmemory==4.0.2
1
+ superlocalmemory==4.0.3
@@ -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.2 · Qualixar · AGPL-3.0-or-later
148
+ SuperLocalMemory v4.0.3 · 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.2 · Qualixar · AGPL-3.0-or-later
150
+ SuperLocalMemory v4.0.3 · 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.2 · Qualixar · AGPL-3.0-or-later*
248
+ *SuperLocalMemory v4.0.3 · Qualixar · AGPL-3.0-or-later*
@@ -311,4 +311,4 @@ profile. See `slm-profile` for the full profile switching workflow.
311
311
 
312
312
  ---
313
313
 
314
- SuperLocalMemory v4.0.2 · Qualixar · AGPL-3.0-or-later
314
+ SuperLocalMemory v4.0.3 · 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.2 · Qualixar · AGPL-3.0-or-later
99
+ SuperLocalMemory v4.0.3 · Qualixar · AGPL-3.0-or-later
@@ -279,4 +279,4 @@ mesh availability.
279
279
 
280
280
  ---
281
281
 
282
- *SuperLocalMemory v4.0.2 · Qualixar · AGPL-3.0-or-later*
282
+ *SuperLocalMemory v4.0.3 · Qualixar · AGPL-3.0-or-later*
@@ -31,9 +31,9 @@ project, a client engagement, a production vs staging environment.
31
31
  | Profile | Tools | When to use |
32
32
  |---------|-------|-------------|
33
33
  | `core` | 14 tools — remember, recall, search, session, optimize | Minimal footprint, no code tools |
34
- | `code` | 24 tools — core + 6 code-graph tools + switch_profile + 3 bounded-loop tools | Default for IDE/coding agents |
35
- | `full` | 42 tools — code + all memory ops + mesh + bounded loops | Multi-session, team workflows |
36
- | `power` | 54 tools — full + governance + behavioral tools | Enterprise, admin, audit use cases |
34
+ | `code` | 28 tools — core + portable Brain evidence + code graph + profile switching + bounded loops | Default for IDE/coding agents |
35
+ | `full` | 46 tools — code + all memory ops + mesh + bounded loops | Multi-session, team workflows |
36
+ | `power` | 58 tools — full + governance + behavioral tools | Enterprise, admin, audit use cases |
37
37
  | `mesh` | 8 tools — mesh coordination only | Lightweight cross-session signalling |
38
38
 
39
39
  The profile is set at MCP server startup via `SLM_MCP_PROFILE` in the MCP config.
@@ -145,4 +145,4 @@ Name them differently in your MCP config (e.g. `superlocalmemory-personal` and
145
145
 
146
146
  ---
147
147
 
148
- *SuperLocalMemory v4.0.2 · Qualixar · AGPL-3.0-or-later*
148
+ *SuperLocalMemory v4.0.3 · 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.2 · Qualixar · AGPL-3.0-or-later*
239
+ *SuperLocalMemory v4.0.3 · 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.2 · Qualixar · AGPL-3.0-or-later*
241
+ *SuperLocalMemory v4.0.3 · 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.2 · Qualixar · AGPL-3.0-or-later*
176
+ *SuperLocalMemory v4.0.3 · 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.2 · Qualixar · AGPL-3.0-or-later*
230
+ *SuperLocalMemory v4.0.3 · 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.2 · Qualixar · AGPL-3.0-or-later
166
+ SuperLocalMemory v4.0.3 · Qualixar · AGPL-3.0-or-later
@@ -82,10 +82,10 @@ When the SLM MCP server is unavailable, use these CLI equivalents:
82
82
 
83
83
  ## Tool reference (core profile — 14 tools)
84
84
 
85
- > The MCP config ships `SLM_MCP_PROFILE=code` (24 tools): the 14 core memory tools below
85
+ > The MCP config ships `SLM_MCP_PROFILE=code` (28 tools): the 14 core memory tools below
86
86
  > **plus** 6 code-graph tools (`build_code_graph`, `get_blast_radius`, `query_graph`,
87
87
  > `semantic_search_code`, `get_review_context`, `detect_changes`) and `switch_profile`.
88
- > Use `full` (42 tools) to add mesh coordination. Use `power` (54 tools) for governance
88
+ > Use `full` (46 tools) to add mesh coordination. Use `power` (58 tools) for governance
89
89
  > and audit tools. See slm-profile for profile switching.
90
90
 
91
91
  | Tool | Signature (key params) | Notes |
@@ -128,4 +128,4 @@ When the SLM MCP server is unavailable, use these CLI equivalents:
128
128
  - **slm-optimize-advisor** — context compression and KV cache
129
129
  - **slm-governance-advisor** — scope/role compliance, retention policies, GDPR
130
130
 
131
- SuperLocalMemory v4.0.2 · Qualixar · AGPL-3.0-or-later
131
+ SuperLocalMemory v4.0.3 · Qualixar · AGPL-3.0-or-later
@@ -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.2 · Qualixar · AGPL-3.0-or-later
148
+ SuperLocalMemory v4.0.3 · 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.2 · Qualixar · AGPL-3.0-or-later
150
+ SuperLocalMemory v4.0.3 · 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.2 · Qualixar · AGPL-3.0-or-later*
248
+ *SuperLocalMemory v4.0.3 · Qualixar · AGPL-3.0-or-later*
@@ -311,4 +311,4 @@ profile. See `slm-profile` for the full profile switching workflow.
311
311
 
312
312
  ---
313
313
 
314
- SuperLocalMemory v4.0.2 · Qualixar · AGPL-3.0-or-later
314
+ SuperLocalMemory v4.0.3 · 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.2 · Qualixar · AGPL-3.0-or-later
99
+ SuperLocalMemory v4.0.3 · Qualixar · AGPL-3.0-or-later
@@ -279,4 +279,4 @@ mesh availability.
279
279
 
280
280
  ---
281
281
 
282
- *SuperLocalMemory v4.0.2 · Qualixar · AGPL-3.0-or-later*
282
+ *SuperLocalMemory v4.0.3 · Qualixar · AGPL-3.0-or-later*
@@ -31,9 +31,9 @@ project, a client engagement, a production vs staging environment.
31
31
  | Profile | Tools | When to use |
32
32
  |---------|-------|-------------|
33
33
  | `core` | 14 tools — remember, recall, search, session, optimize | Minimal footprint, no code tools |
34
- | `code` | 24 tools — core + 6 code-graph tools + switch_profile + 3 bounded-loop tools | Default for IDE/coding agents |
35
- | `full` | 42 tools — code + all memory ops + mesh + bounded loops | Multi-session, team workflows |
36
- | `power` | 54 tools — full + governance + behavioral tools | Enterprise, admin, audit use cases |
34
+ | `code` | 28 tools — core + portable Brain evidence + code graph + profile switching + bounded loops | Default for IDE/coding agents |
35
+ | `full` | 46 tools — code + all memory ops + mesh + bounded loops | Multi-session, team workflows |
36
+ | `power` | 58 tools — full + governance + behavioral tools | Enterprise, admin, audit use cases |
37
37
  | `mesh` | 8 tools — mesh coordination only | Lightweight cross-session signalling |
38
38
 
39
39
  The profile is set at MCP server startup via `SLM_MCP_PROFILE` in the MCP config.
@@ -145,4 +145,4 @@ Name them differently in your MCP config (e.g. `superlocalmemory-personal` and
145
145
 
146
146
  ---
147
147
 
148
- *SuperLocalMemory v4.0.2 · Qualixar · AGPL-3.0-or-later*
148
+ *SuperLocalMemory v4.0.3 · 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.2 · Qualixar · AGPL-3.0-or-later*
239
+ *SuperLocalMemory v4.0.3 · 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.2 · Qualixar · AGPL-3.0-or-later*
241
+ *SuperLocalMemory v4.0.3 · 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.2 · Qualixar · AGPL-3.0-or-later*
176
+ *SuperLocalMemory v4.0.3 · 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.2 · Qualixar · AGPL-3.0-or-later*
230
+ *SuperLocalMemory v4.0.3 · 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.2 · Qualixar · AGPL-3.0-or-later
166
+ SuperLocalMemory v4.0.3 · Qualixar · AGPL-3.0-or-later
package/pyproject.toml CHANGED
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "superlocalmemory"
3
- version = "4.0.2"
3
+ version = "4.0.3"
4
4
  description = "Local-first agent memory with auditable hybrid retrieval"
5
5
  readme = "README.md"
6
6
  license = "AGPL-3.0-or-later"
@@ -554,6 +554,7 @@ function printFirstRunChecklist(config) {
554
554
  console.log('Next steps:');
555
555
  console.log(' slm status --verbose — daemon, mode, dashboard, health');
556
556
  console.log(' slm doctor — run health checks (DB, models, ports)');
557
+ console.log(' slm upgrade-hosts — preview existing host integrations after an update');
557
558
  console.log(' slm health --watch — live health ladder readout');
558
559
  console.log(' slm dashboard — open the dashboard in your browser');
559
560
  console.log('');
@@ -206,6 +206,10 @@ function main(argv = process.argv.slice(2)) {
206
206
  console.log('');
207
207
  console.log(' slm setup');
208
208
  console.log('');
209
+ console.log(' If this updated an existing SLM installation, preview host integrations first:');
210
+ console.log('');
211
+ console.log(' slm upgrade-hosts');
212
+ console.log('');
209
213
  console.log(' Prefer to tune performance profiles? Use: slm reconfigure');
210
214
  console.log('');
211
215
  return 0;
@@ -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.2"
35
+ __version__ = "4.0.3"
36
36
 
37
37
  _REQUIRED_VERSIONS = {
38
38
  "sentence_transformers": "5.3.0",
@@ -321,25 +321,22 @@ def cmd_session(args: Namespace) -> None:
321
321
  print("Session close failed (daemon unreachable?)")
322
322
 
323
323
 
324
+ def _cmd_upgrade_hosts(args: Namespace) -> None:
325
+ """Run the consented host-integration refresh command."""
326
+ from superlocalmemory.cli.host_upgrades import cmd_upgrade_hosts
327
+
328
+ cmd_upgrade_hosts(args)
329
+
330
+
324
331
  def dispatch(args: Namespace) -> None:
325
332
  """Route CLI command to the appropriate handler."""
326
- # Auto-install/upgrade hooks on version change (single file read, ~0.1ms)
327
- if (
328
- args.command not in ("hooks", "codex", "init", "mcp")
329
- and not getattr(args, "dry_run", False)
330
- ):
331
- try:
332
- from superlocalmemory.hooks.claude_code_hooks import auto_install_if_needed
333
- auto_install_if_needed()
334
- except Exception:
335
- pass
336
-
337
333
  handlers = {
338
334
  "init": cmd_init,
339
335
  "setup": cmd_setup,
340
336
  "mode": cmd_mode,
341
337
  "provider": cmd_provider,
342
338
  "connect": cmd_connect,
339
+ "upgrade-hosts": _cmd_upgrade_hosts,
343
340
  "migrate": cmd_migrate,
344
341
  "list": cmd_list,
345
342
  "remember": cmd_remember,
@@ -2151,6 +2148,7 @@ _COMMAND_GROUPS: list[tuple[str, list[tuple[str, str]]]] = [
2151
2148
  ("mode", "Switch memory mode: a (local) / b (Ollama) / c (cloud)"),
2152
2149
  ("provider", "Configure the cloud LLM provider + API key (Mode C)"),
2153
2150
  ("connect", "Auto-configure detected IDEs (Cursor, VS Code, …)"),
2151
+ ("upgrade-hosts", "Preview or explicitly refresh existing SLM host integrations"),
2154
2152
  ("hooks", "Install/inspect Claude Code hooks"),
2155
2153
  ("codex", "Configure the Codex / OpenAI integration"),
2156
2154
  ]),
@@ -2206,6 +2204,7 @@ _COMMAND_GROUPS: list[tuple[str, list[tuple[str, str]]]] = [
2206
2204
  ("Learning & maintenance", [
2207
2205
  ("evolve", "Skill-evolution controls"),
2208
2206
  ("observe", "External observation / telemetry ingestion"),
2207
+ ("brain", "Show profile-scoped Living Brain evidence"),
2209
2208
  ("decay", "Run a forgetting/decay pass"),
2210
2209
  ("consolidate", "Merge/consolidate related memories"),
2211
2210
  ("quantize", "Quantize embeddings to save space"),
@@ -2967,14 +2966,6 @@ def cmd_mcp(_args: Namespace) -> None:
2967
2966
  except Exception:
2968
2967
  pass # A diagnostic must never prevent the server from starting.
2969
2968
 
2970
- # Auto-install hooks on MCP startup (fast path: ~0.1ms if already current)
2971
- # CRITICAL: No stdout — MCP uses stdio transport, any print corrupts protocol
2972
- try:
2973
- from superlocalmemory.hooks.claude_code_hooks import auto_install_if_needed
2974
- auto_install_if_needed()
2975
- except Exception:
2976
- pass
2977
-
2978
2969
  from superlocalmemory.mcp.server import server
2979
2970
 
2980
2971
  server.run(transport="stdio")
@@ -0,0 +1,175 @@
1
+ """Consented, non-destructive upgrades for existing host integrations.
2
+
3
+ Package installation owns the SLM executable. This module owns the separate
4
+ operator-approved step that refreshes SLM-owned integration assets. It never
5
+ discovers a host and edits it implicitly: preview is the default and apply
6
+ requires either explicit hosts or an explicit all-detected acknowledgement.
7
+ """
8
+
9
+ from __future__ import annotations
10
+
11
+ from argparse import Namespace
12
+ from pathlib import Path
13
+ from typing import Any
14
+
15
+
16
+ def validate_upgrade_request(*, apply: bool, hosts: list[str], all_detected: bool) -> None:
17
+ """Reject unbounded mutations before any host filesystem access."""
18
+ if apply and not hosts and not all_detected:
19
+ raise ValueError("--apply requires at least one --host or --all-detected")
20
+ if hosts and all_detected:
21
+ raise ValueError("choose explicit --host values or --all-detected, not both")
22
+
23
+
24
+ def cmd_upgrade_hosts(args: Namespace) -> None:
25
+ """Preview or explicitly apply host integration refreshes."""
26
+ hosts = list(getattr(args, "hosts", []) or [])
27
+ apply = bool(getattr(args, "apply", False))
28
+ all_detected = bool(getattr(args, "all_detected", False))
29
+ try:
30
+ validate_upgrade_request(apply=apply, hosts=hosts, all_detected=all_detected)
31
+ except ValueError as exc:
32
+ print(f"Error: {exc}")
33
+ return
34
+
35
+ from superlocalmemory.hooks.portable_kit import supported_ides
36
+
37
+ detected = set(_detected_hosts())
38
+ targets = sorted(detected) if all_detected else (hosts or sorted(detected))
39
+ managed_hosts = set(supported_ides()) | {"claude-code", "hermes"}
40
+ unknown = sorted(set(targets) - managed_hosts)
41
+ if unknown:
42
+ print(f"Error: unsupported host(s): {', '.join(unknown)}")
43
+ return
44
+ if not targets:
45
+ print("No existing SLM host integrations were detected.")
46
+ print("Run `slm setup` for first-time setup, or use `--host <name>` to target one host.")
47
+ return
48
+
49
+ operation = "Applying" if apply else "Previewing"
50
+ print(f"{operation} SLM host upgrades: {', '.join(targets)}")
51
+ if not apply:
52
+ print("No host files will be changed. Re-run with --apply and explicit targets to proceed.")
53
+
54
+ for host in targets:
55
+ result = _upgrade_host(host, apply=apply, already_integrated=host in detected)
56
+ status = result.get("status", "error")
57
+ detail = result.get("detail", "")
58
+ print(f" [{status}] {host}: {detail}")
59
+
60
+ if apply:
61
+ print("Restart affected host applications, then run `slm doctor` to verify SLM itself.")
62
+
63
+
64
+ def _detected_hosts(home: Path | None = None) -> list[str]:
65
+ """Return only hosts already containing an SLM-owned integration block."""
66
+ from superlocalmemory.hooks.portable_kit import (
67
+ IDE_MATRIX,
68
+ _load_config,
69
+ _ParseError,
70
+ )
71
+
72
+ effective_home = home or Path.home()
73
+ detected: list[str] = []
74
+ for host, desc in IDE_MATRIX.items():
75
+ if not desc.fmt:
76
+ continue
77
+ path = effective_home / desc.mcp_path_global
78
+ try:
79
+ data = _load_config(path, desc.fmt)
80
+ except _ParseError:
81
+ continue
82
+ if _contains_slm_block(data, desc):
83
+ detected.append(host)
84
+
85
+ # Claude Code's plugin is host-managed. A local SLM hook installation is
86
+ # the durable evidence that its SLM integration exists; upgrading the
87
+ # plugin remains an explicit Claude Code marketplace action.
88
+ try:
89
+ from superlocalmemory.hooks.claude_code_hooks import check_status
90
+
91
+ if check_status().get("installed"):
92
+ detected.append("claude-code")
93
+ except Exception:
94
+ pass
95
+
96
+ # Hermes has a native YAML mapping rather than the portable-kit schema.
97
+ # Detect it for reporting, but never overwrite it with an invented format.
98
+ hermes_path = effective_home / ".hermes" / "config.yaml"
99
+ try:
100
+ hermes = _load_config(hermes_path, "yaml")
101
+ servers = hermes.get("mcp_servers", {})
102
+ if isinstance(servers, dict) and "superlocalmemory" in servers:
103
+ detected.append("hermes")
104
+ except _ParseError:
105
+ pass
106
+ return sorted(set(detected))
107
+
108
+
109
+ def _contains_slm_block(data: dict[str, Any], desc: Any) -> bool:
110
+ if desc.fmt == "yaml":
111
+ providers = data.get(desc.server_key, [])
112
+ return isinstance(providers, list) and any(
113
+ isinstance(item, dict)
114
+ and item.get("params", {}).get("serverName") == "superlocalmemory"
115
+ for item in providers
116
+ )
117
+ servers = data.get(desc.server_key, {})
118
+ return isinstance(servers, dict) and "superlocalmemory" in servers
119
+
120
+
121
+ def _upgrade_host(host: str, *, apply: bool, already_integrated: bool) -> dict[str, str]:
122
+ """Refresh assets without degrading a working, host-specific MCP block."""
123
+ if host == "claude-code":
124
+ return {
125
+ "status": "plugin-managed",
126
+ "detail": "run `claude plugin update superlocalmemory@qualixar` in Claude Code",
127
+ }
128
+
129
+ if host == "hermes":
130
+ if already_integrated:
131
+ return {
132
+ "status": "verified",
133
+ "detail": "existing native Hermes SLM mapping preserved",
134
+ }
135
+ return {
136
+ "status": "blocked",
137
+ "detail": "Hermes is not connected; follow docs/ide-setup.md before retrying",
138
+ }
139
+
140
+ if host == "codex" and already_integrated:
141
+ from superlocalmemory.hooks.codex_assets import install_assets
142
+ from superlocalmemory.hooks.codex_hooks import install_hooks
143
+
144
+ assets, hooks = install_assets(dry_run=not apply), install_hooks(dry_run=not apply)
145
+ if not assets.get("success") or not hooks.get("success"):
146
+ return {"status": "blocked", "detail": "could not refresh SLM-owned Codex assets"}
147
+ action = "would refresh" if not apply else "refreshed"
148
+ return {
149
+ "status": "updated" if apply else "preview",
150
+ "detail": (
151
+ f"{action} SLM-owned Codex skills, agents, and hooks; "
152
+ "MCP block preserved"
153
+ ),
154
+ }
155
+
156
+ if already_integrated:
157
+ return {
158
+ "status": "verified",
159
+ "detail": "existing SLM MCP block preserved; no portable host assets require refresh",
160
+ }
161
+
162
+ # An explicitly named, not-yet-connected host is a first-time connection.
163
+ # This branch is never reached by --all-detected.
164
+ from superlocalmemory.hooks.portable_kit import connect_ide
165
+
166
+ result = connect_ide(host, dry_run=not apply)
167
+ if result.get("error"):
168
+ return {"status": "blocked", "detail": str(result["error"])}
169
+ action = result.get("mcp_config", "unknown")
170
+ if not apply:
171
+ return {"status": "preview", "detail": f"would refresh SLM MCP block ({action})"}
172
+ return {"status": "updated", "detail": f"SLM MCP block {action}"}
173
+
174
+
175
+ __all__ = ("cmd_upgrade_hosts", "validate_upgrade_request")
@@ -69,7 +69,7 @@ documentation:
69
69
 
70
70
 
71
71
  _NO_DAEMON_COMMANDS = {
72
- "setup", "mode", "provider", "connect", "migrate", "mcp", "warmup", "hooks", "codex",
72
+ "setup", "mode", "provider", "connect", "upgrade-hosts", "migrate", "mcp", "warmup", "hooks", "codex",
73
73
  "config", "evolve", "db",
74
74
  # v3.4.22 escape hatches — never auto-start the daemon on these.
75
75
  "disable", "enable", "clear-cache", "reconfigure", "benchmark",
@@ -123,12 +123,17 @@ def main() -> None:
123
123
  and sys.argv[1] == "connect"
124
124
  and "--dry-run" in sys.argv[2:]
125
125
  )
126
+ _is_host_upgrade_preview = (
127
+ len(sys.argv) >= 2
128
+ and sys.argv[1] == "upgrade-hosts"
129
+ and "--apply" not in sys.argv[2:]
130
+ )
126
131
 
127
132
  # WP-07: lazy first-run init — runs after hook/mcp fast-paths so stdout
128
133
  # is never polluted on those paths (CRIT-3, MCP JSON-RPC purity).
129
134
  # Guarded: any failure must not crash the CLI (AC4).
130
135
  _is_mcp_cmd = len(sys.argv) >= 2 and sys.argv[1] == "mcp"
131
- if not _is_mcp_cmd and not _is_metadata_cmd and not _is_connect_dry_run:
136
+ if not _is_mcp_cmd and not _is_metadata_cmd and not _is_connect_dry_run and not _is_host_upgrade_preview:
132
137
  try:
133
138
  from superlocalmemory.cli._lazy_init import _ensure_initialized
134
139
  _ensure_initialized()
@@ -148,7 +153,7 @@ def main() -> None:
148
153
 
149
154
  # One-time post-upgrade banner — silent for fresh installs and
150
155
  # same-version runs. Guarded against I/O errors internally.
151
- if not _is_mcp_stdio and not _is_metadata_cmd and not _is_connect_dry_run:
156
+ if not _is_mcp_stdio and not _is_metadata_cmd and not _is_connect_dry_run and not _is_host_upgrade_preview:
152
157
  from superlocalmemory.cli.version_banner import check_and_emit_upgrade_banner
153
158
  if check_and_emit_upgrade_banner(_ver):
154
159
  # First post-upgrade invocation: apply the data-dir migration if
@@ -285,6 +290,23 @@ def main() -> None:
285
290
  ),
286
291
  )
287
292
 
293
+ upgrade_p = sub.add_parser(
294
+ "upgrade-hosts",
295
+ help="Preview or explicitly refresh installed SLM host integrations",
296
+ )
297
+ upgrade_p.add_argument(
298
+ "--host", action="append", dest="hosts", default=[],
299
+ help="Explicit host to refresh (repeatable; for example: codex, cursor)",
300
+ )
301
+ upgrade_p.add_argument(
302
+ "--all-detected", action="store_true", default=False,
303
+ help="Target only hosts that already contain an SLM integration",
304
+ )
305
+ upgrade_p.add_argument(
306
+ "--apply", action="store_true", default=False,
307
+ help="Apply the previewed changes; default is read-only preview",
308
+ )
309
+
288
310
  migrate_p = sub.add_parser("migrate", help="Migrate data from V2 to V3 schema")
289
311
  migrate_p.add_argument(
290
312
  "--rollback", action="store_true", help="Rollback migration",
@@ -966,7 +988,10 @@ def main() -> None:
966
988
  sys.exit(0)
967
989
 
968
990
  # V3.3.19: Auto-trigger setup wizard on first use
969
- if not (args.command == "connect" and getattr(args, "dry_run", False)):
991
+ if not (
992
+ (args.command == "connect" and getattr(args, "dry_run", False))
993
+ or (args.command == "upgrade-hosts" and not getattr(args, "apply", False))
994
+ ):
970
995
  from superlocalmemory.cli.setup_wizard import check_first_use
971
996
  check_first_use(args.command)
972
997
 
@@ -23,7 +23,14 @@ _PROFILE_CORE: frozenset[str] = frozenset({ # 14
23
23
  "slm_compress", "slm_retrieve", "slm_cache_set", "slm_cache_get", "slm_optimize_stats",
24
24
  })
25
25
 
26
- _PROFILE_CODE: frozenset[str] = _PROFILE_CORE | frozenset({ # 24
26
+ # Portable Brain evidence must reach the coding-host profile shipped by the
27
+ # Claude/Codex plugins, not only an unrestricted server.
28
+ _PROFILE_BRAIN: frozenset[str] = frozenset({
29
+ "get_brain_evidence_status", "record_agent_experience",
30
+ "record_cognitive_turn", "finalize_cognitive_turn",
31
+ })
32
+
33
+ _PROFILE_CODE: frozenset[str] = _PROFILE_CORE | _PROFILE_BRAIN | frozenset({ # 28
27
34
  "build_code_graph", "get_blast_radius", "query_graph",
28
35
  "semantic_search_code", "get_review_context", "detect_changes",
29
36
  # switch_profile lets a plugin/IDE session change the active workspace over
@@ -40,23 +47,21 @@ _PROFILE_FULL_MESH: frozenset[str] = frozenset({ # 8
40
47
  "mesh_state", "mesh_lock", "mesh_events", "mesh_status",
41
48
  })
42
49
 
43
- _PROFILE_FULL: frozenset[str] = frozenset({ # 34 base — EXPLICIT literal, NOT runtime _ESSENTIAL_TOOLS (OQ-2)
50
+ _PROFILE_FULL: frozenset[str] = frozenset({ # 38 base — EXPLICIT literal, NOT runtime _ESSENTIAL_TOOLS (OQ-2)
44
51
  "remember", "recall", "search", "fetch", "list_recent", "delete_memory", "update_memory",
45
52
  "get_status", "session_init", "observe", "close_session", "report_feedback", "forget",
46
53
  "run_maintenance", "consolidate_cognitive", "get_soft_prompts", "set_mode", "report_outcome",
47
54
  "log_tool_event", "get_assertions", "reinforce_assertion", "contradict_assertion",
55
+ "get_brain_evidence_status", "record_agent_experience",
56
+ "record_cognitive_turn", "finalize_cognitive_turn",
48
57
  "evolve_skill", "skill_health", "skill_lineage", "switch_profile",
49
58
  "slm_compress", "slm_retrieve", "slm_cache_set", "slm_cache_get", "slm_optimize_stats",
50
59
  # v3.8.0: bounded-loop tools (CLI + /slm-loop command + MCP).
51
60
  "slm_loop_run", "slm_loop_history", "slm_loop_show",
52
- # v4: prestage_context IS registered (see mcp/server.py) but is deliberately
53
- # NOT in full/power. The profile names are a user-facing config contract
54
- # (SLM_MCP_PROFILE=full42) and the published tool-count table depends on
55
- # them; adding a tool here would make "full42" serve 43 tools. New tools
56
- # reach users through the `whole` profile until a profile rename is shipped.
57
- }) | _PROFILE_FULL_MESH # 42
61
+ # prestage_context remains registered but deliberately raw-server-only.
62
+ }) | _PROFILE_FULL_MESH # 46
58
63
 
59
- _PROFILE_POWER: frozenset[str] = _PROFILE_FULL | frozenset({ # 54
64
+ _PROFILE_POWER: frozenset[str] = _PROFILE_FULL | frozenset({ # 58
60
65
  "get_version", "get_mode", "health", "consistency_check", "recall_trace",
61
66
  "get_lifecycle_status", "set_retention_policy", "compact_memories",
62
67
  "get_behavioral_patterns", "audit_trail", "quantize", "get_retention_stats",
@@ -85,15 +90,19 @@ _PROFILE_ALIASES: dict[str, str] = {
85
90
  "code20": "code",
86
91
  "code21": "code",
87
92
  "code24": "code",
93
+ "code28": "code",
88
94
  "full38": "full",
89
95
  "full39": "full",
90
96
  "full42": "full",
97
+ "full46": "full",
91
98
  "power50": "power",
92
99
  "power51": "power",
93
100
  "power54": "power",
101
+ "power58": "power",
94
102
  "mesh8": "mesh",
95
103
  "whole81": "whole",
96
104
  "whole84": "whole",
105
+ "whole91": "whole",
97
106
  }
98
107
 
99
108
  # Plain-English descriptions for UI display.
@@ -101,8 +110,8 @@ _PROFILE_ALIASES: dict[str, str] = {
101
110
  # one sentence, user-facing language only.
102
111
  PROFILE_DESCRIPTIONS: dict[str, str] = {
103
112
  "core": "Essential memory: store, recall, search, sessions",
104
- "code": "Core + code-graph tools + profile switching (default for IDE coding agents)",
105
- "full": "All everyday memory, optimization, and mesh tools",
106
- "power": "Everything in full plus advanced governance/behavioral tools",
113
+ "code": "Core + code graph, portable Brain evidence, and profile switching (default for IDE coding agents)",
114
+ "full": "All everyday memory, portable Brain evidence, optimization, and mesh tools",
115
+ "power": "Everything in full plus advanced governance and behavioral tools",
107
116
  "mesh": "Cross-device mesh coordination only",
108
117
  }
@@ -77,13 +77,13 @@ def reset_engine():
77
77
 
78
78
  # Register tools and resources -------------------------------------------------
79
79
  #
80
- # Essential-only default: 34 base tools + 8 mesh tools = 42 registered
80
+ # Essential-only default: 38 base tools + 8 mesh tools = 46 registered
81
81
  # when mesh is enabled. Set ``SLM_MCP_ALL_TOOLS=1`` to expose the full
82
82
  # toolset. Rationale: IDEs cap at 50-100 tools total (Cursor,
83
83
  # Antigravity, Windsurf) and a maximal SLM registration crowds out
84
84
  # other MCP servers the user may have installed.
85
85
  # Admin/diagnostics tools remain available via CLI (`slm <command>`).
86
- # Set SLM_MCP_ALL_TOOLS=1 to enable all 87 tools (power users).
86
+ # Set SLM_MCP_ALL_TOOLS=1 to enable all 91 tools (power users).
87
87
 
88
88
  import os as _os_reg
89
89
 
@@ -103,10 +103,8 @@ _ESSENTIAL_TOOLS: set[str] = {
103
103
  # Memory management (2)
104
104
  "forget", "run_maintenance",
105
105
  # NOTE: prestage_context IS registered (see register_prestage_tool below)
106
- # but is deliberately absent from the default surface. _ESSENTIAL_TOOLS must
107
- # stay at 42 to match the full42 profile: the profile names are a
108
- # user-facing config contract and the published tool-count table depends on
109
- # them. New tools reach users via the `whole` profile until a rename ships.
106
+ # but is deliberately absent from the default surface. Brain evidence is
107
+ # intentionally present: it is the portable contract for installed agents.
110
108
  # Infinite memory + learning (4)
111
109
  "consolidate_cognitive", "get_soft_prompts",
112
110
  "set_mode", "report_outcome",
@@ -9,9 +9,9 @@
9
9
  // current: "core",
10
10
  // profiles: {
11
11
  // core: { count: 14, tools: [...], description: "..." },
12
- // code: { count: 24, tools: [...], description: "..." },
13
- // full: { count: 42, tools: [...], description: "..." },
14
- // power: { count: 54, tools: [...], description: "..." },
12
+ // code: { count: 28, tools: [...], description: "..." },
13
+ // full: { count: 46, tools: [...], description: "..." },
14
+ // power: { count: 58, tools: [...], description: "..." },
15
15
  // mesh: { count: 8, tools: [...], description: "..." },
16
16
  // },
17
17
  // aliases: { "code21": "code", ... },
@@ -370,9 +370,9 @@
370
370
  codeBlock.textContent =
371
371
  '"env": {\n' +
372
372
  ' "SLM_MCP_PROFILE": "core" // 14 tools — minimal\n' +
373
- ' // "SLM_MCP_PROFILE": "code" // 24 tools — + code graph + loops\n' +
374
- ' // "SLM_MCP_PROFILE": "full" // 42 tools — + mesh\n' +
375
- ' // "SLM_MCP_PROFILE": "power" // 54 tools — + governance\n' +
373
+ ' // "SLM_MCP_PROFILE": "code" // 28 tools — + Brain, code graph, loops\n' +
374
+ ' // "SLM_MCP_PROFILE": "full" // 46 tools — + mesh\n' +
375
+ ' // "SLM_MCP_PROFILE": "power" // 58 tools — + governance\n' +
376
376
  ' // "SLM_MCP_PROFILE": "mesh" // 8 tools — mesh only\n' +
377
377
  '}';
378
378
  body2.appendChild(codeBlock);