superlocalmemory 3.8.13 → 4.0.0

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 (212) hide show
  1. package/ATTRIBUTION.md +4 -4
  2. package/CHANGELOG.md +113 -121
  3. package/README.md +65 -63
  4. package/docs/pi-dev-integration.md +1 -1
  5. package/package.json +6 -1
  6. package/plugin/.claude-plugin/plugin.json +1 -1
  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 +1 -1
  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 +1 -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 +1 -1
  26. package/plugin-src/skills/slm-cache/SKILL.md +1 -1
  27. package/plugin-src/skills/slm-compress/SKILL.md +1 -1
  28. package/plugin-src/skills/slm-governance/SKILL.md +248 -0
  29. package/plugin-src/skills/slm-graph/SKILL.md +1 -1
  30. package/plugin-src/skills/slm-loop/SKILL.md +99 -0
  31. package/plugin-src/skills/slm-mesh/SKILL.md +282 -0
  32. package/plugin-src/skills/slm-profile/SKILL.md +148 -0
  33. package/plugin-src/skills/slm-recall/SKILL.md +1 -1
  34. package/plugin-src/skills/slm-remember/SKILL.md +1 -1
  35. package/plugin-src/skills/slm-scope/SKILL.md +176 -0
  36. package/plugin-src/skills/slm-session/SKILL.md +1 -1
  37. package/plugin-src/skills/slm-status/SKILL.md +1 -1
  38. package/pyproject.toml +11 -4
  39. package/src/superlocalmemory/__init__.py +1 -1
  40. package/src/superlocalmemory/cli/commands.py +125 -11
  41. package/src/superlocalmemory/cli/daemon.py +5 -1
  42. package/src/superlocalmemory/cli/main.py +35 -2
  43. package/src/superlocalmemory/cli/ops_cmd.py +281 -0
  44. package/src/superlocalmemory/cli/setup_wizard.py +1 -1
  45. package/src/superlocalmemory/compliance/audit.py +65 -0
  46. package/src/superlocalmemory/compliance/eu_ai_act.py +27 -57
  47. package/src/superlocalmemory/compliance/gdpr.py +416 -20
  48. package/src/superlocalmemory/compliance/retention.py +74 -22
  49. package/src/superlocalmemory/compliance/scheduler.py +78 -9
  50. package/src/superlocalmemory/core/actor_context.py +166 -0
  51. package/src/superlocalmemory/core/admission.py +549 -0
  52. package/src/superlocalmemory/core/backend_orchestrator.py +23 -10
  53. package/src/superlocalmemory/core/config.py +202 -24
  54. package/src/superlocalmemory/core/consolidation_engine.py +13 -13
  55. package/src/superlocalmemory/core/context_cache.py +28 -0
  56. package/src/superlocalmemory/core/embeddings.py +64 -2
  57. package/src/superlocalmemory/core/engine.py +7 -2
  58. package/src/superlocalmemory/core/engine_ingestion.py +65 -3
  59. package/src/superlocalmemory/core/engine_wiring.py +36 -9
  60. package/src/superlocalmemory/core/ingest_policy.py +38 -0
  61. package/src/superlocalmemory/core/maintenance.py +255 -0
  62. package/src/superlocalmemory/core/modes.py +40 -13
  63. package/src/superlocalmemory/core/mutations.py +437 -44
  64. package/src/superlocalmemory/core/operation_policy.py +92 -0
  65. package/src/superlocalmemory/core/operation_policy_registry.py +542 -0
  66. package/src/superlocalmemory/core/operation_request.py +127 -0
  67. package/src/superlocalmemory/core/ops_remediation.py +542 -0
  68. package/src/superlocalmemory/core/recall_pipeline.py +7 -0
  69. package/src/superlocalmemory/core/remember_runtime.py +202 -4
  70. package/src/superlocalmemory/core/remote_mode.py +20 -5
  71. package/src/superlocalmemory/core/store_pipeline.py +150 -0
  72. package/src/superlocalmemory/core/topic_signature.py +19 -4
  73. package/src/superlocalmemory/core/transactions/__init__.py +78 -0
  74. package/src/superlocalmemory/core/transactions/concrete_owners.py +597 -0
  75. package/src/superlocalmemory/core/transactions/erasure.py +825 -0
  76. package/src/superlocalmemory/core/transactions/manifest.py +255 -0
  77. package/src/superlocalmemory/core/transactions/manifest_key.py +155 -0
  78. package/src/superlocalmemory/core/transactions/obligations.py +272 -0
  79. package/src/superlocalmemory/core/transactions/owners.py +114 -0
  80. package/src/superlocalmemory/core/transactions/reconciler.py +285 -0
  81. package/src/superlocalmemory/core/transactions/service.py +330 -0
  82. package/src/superlocalmemory/core/worker_pool.py +33 -5
  83. package/src/superlocalmemory/encoding/cognitive_consolidator.py +70 -28
  84. package/src/superlocalmemory/encoding/emotional.py +75 -14
  85. package/src/superlocalmemory/encoding/scene_builder.py +115 -13
  86. package/src/superlocalmemory/encoding/temporal_parser.py +4 -0
  87. package/src/superlocalmemory/evolution/blind_verifier.py +11 -4
  88. package/src/superlocalmemory/evolution/evolution_store.py +244 -4
  89. package/src/superlocalmemory/evolution/llm_dispatch.py +40 -0
  90. package/src/superlocalmemory/evolution/model_selection.py +18 -3
  91. package/src/superlocalmemory/evolution/mutation_generator.py +3 -0
  92. package/src/superlocalmemory/evolution/skill_activator.py +270 -0
  93. package/src/superlocalmemory/evolution/skill_evolver.py +281 -59
  94. package/src/superlocalmemory/evolution/types.py +30 -8
  95. package/src/superlocalmemory/graph/cozo_backend.py +17 -9
  96. package/src/superlocalmemory/hooks/auto_invoker.py +2 -1
  97. package/src/superlocalmemory/hooks/auto_recall.py +64 -30
  98. package/src/superlocalmemory/hooks/codex_assets.py +14 -1
  99. package/src/superlocalmemory/infra/backup.py +434 -7
  100. package/src/superlocalmemory/infra/process_reaper.py +18 -0
  101. package/src/superlocalmemory/infra/self_heal.py +401 -0
  102. package/src/superlocalmemory/learning/feedback.py +52 -9
  103. package/src/superlocalmemory/loops/engine.py +10 -0
  104. package/src/superlocalmemory/mcp/_daemon_proxy.py +3 -0
  105. package/src/superlocalmemory/mcp/http_transport.py +30 -331
  106. package/src/superlocalmemory/mcp/profiles.py +5 -0
  107. package/src/superlocalmemory/mcp/resources.py +8 -0
  108. package/src/superlocalmemory/mcp/server.py +51 -4
  109. package/src/superlocalmemory/mcp/shared.py +19 -0
  110. package/src/superlocalmemory/mcp/tools_active.py +25 -4
  111. package/src/superlocalmemory/mcp/tools_code_graph.py +26 -18
  112. package/src/superlocalmemory/mcp/tools_context.py +50 -8
  113. package/src/superlocalmemory/mcp/tools_core.py +69 -21
  114. package/src/superlocalmemory/mcp/tools_evolution.py +9 -2
  115. package/src/superlocalmemory/mcp/tools_learning.py +21 -10
  116. package/src/superlocalmemory/mcp/tools_loops.py +29 -18
  117. package/src/superlocalmemory/mcp/tools_mesh.py +8 -0
  118. package/src/superlocalmemory/mcp/tools_ops.py +115 -0
  119. package/src/superlocalmemory/mcp/tools_optimize.py +4 -0
  120. package/src/superlocalmemory/mcp/tools_v28.py +10 -3
  121. package/src/superlocalmemory/mcp/tools_v3.py +34 -14
  122. package/src/superlocalmemory/mcp/tools_v33.py +18 -33
  123. package/src/superlocalmemory/mesh/broker.py +124 -46
  124. package/src/superlocalmemory/mesh/broker_security.py +470 -0
  125. package/src/superlocalmemory/mesh/discovery.py +365 -0
  126. package/src/superlocalmemory/mesh/lock_protocol.py +313 -0
  127. package/src/superlocalmemory/mesh/node_identity.py +97 -0
  128. package/src/superlocalmemory/mesh/outbox_remote.py +429 -0
  129. package/src/superlocalmemory/mesh/remote_sync.py +511 -28
  130. package/src/superlocalmemory/mesh/state_sync.py +286 -0
  131. package/src/superlocalmemory/optimize/config/store.py +45 -0
  132. package/src/superlocalmemory/parameterization/cross_project.py +12 -0
  133. package/src/superlocalmemory/parameterization/prompt_injector.py +13 -11
  134. package/src/superlocalmemory/parameterization/prompt_lifecycle.py +8 -2
  135. package/src/superlocalmemory/parameterization/workflow_miner.py +17 -0
  136. package/src/superlocalmemory/retrieval/ann_index.py +5 -0
  137. package/src/superlocalmemory/retrieval/bm25_channel.py +49 -2
  138. package/src/superlocalmemory/retrieval/engine.py +19 -4
  139. package/src/superlocalmemory/retrieval/fusion.py +4 -1
  140. package/src/superlocalmemory/retrieval/hopfield_channel.py +9 -3
  141. package/src/superlocalmemory/retrieval/remote_reranker.py +47 -22
  142. package/src/superlocalmemory/retrieval/reranker.py +32 -1
  143. package/src/superlocalmemory/retrieval/temporal_channel.py +16 -3
  144. package/src/superlocalmemory/retrieval/temporal_utils.py +107 -0
  145. package/src/superlocalmemory/retrieval/temporal_validity_filter.py +155 -42
  146. package/src/superlocalmemory/retrieval/vector_store.py +214 -8
  147. package/src/superlocalmemory/server/api.py +5 -5
  148. package/src/superlocalmemory/server/egress_policy.py +258 -0
  149. package/src/superlocalmemory/server/rbac_enforce.py +32 -0
  150. package/src/superlocalmemory/server/route_mutations.py +20 -0
  151. package/src/superlocalmemory/server/routes/compliance.py +153 -7
  152. package/src/superlocalmemory/server/routes/data_io.py +43 -2
  153. package/src/superlocalmemory/server/routes/events.py +15 -0
  154. package/src/superlocalmemory/server/routes/memories.py +56 -3
  155. package/src/superlocalmemory/server/routes/mesh.py +82 -1
  156. package/src/superlocalmemory/server/routes/mesh_lock.py +54 -0
  157. package/src/superlocalmemory/server/routes/mesh_state.py +63 -0
  158. package/src/superlocalmemory/server/routes/v3_api.py +50 -27
  159. package/src/superlocalmemory/server/routes/ws.py +86 -0
  160. package/src/superlocalmemory/server/ui.py +6 -6
  161. package/src/superlocalmemory/server/unified_daemon.py +942 -119
  162. package/src/superlocalmemory/storage/_migration_internals.py +568 -0
  163. package/src/superlocalmemory/storage/_schema_version.py +110 -0
  164. package/src/superlocalmemory/storage/database.py +329 -24
  165. package/src/superlocalmemory/storage/embedding_migrator.py +246 -51
  166. package/src/superlocalmemory/storage/erasure_fence.py +45 -0
  167. package/src/superlocalmemory/storage/generation_fence.py +63 -0
  168. package/src/superlocalmemory/storage/migration_runner.py +140 -417
  169. package/src/superlocalmemory/storage/migrations/M009_model_lineage.py +40 -0
  170. package/src/superlocalmemory/storage/migrations/M033_projection_transactions.py +148 -0
  171. package/src/superlocalmemory/storage/migrations/M034_obligation_integrity.py +58 -0
  172. package/src/superlocalmemory/storage/migrations/M035_erasure_receipts.py +113 -0
  173. package/src/superlocalmemory/storage/migrations/M036_vector_row_map.py +107 -0
  174. package/src/superlocalmemory/storage/migrations/M037_manifest_hmac_version.py +162 -0
  175. package/src/superlocalmemory/storage/migrations/{M033_learning_feedback_channel.py → M038_learning_feedback_channel.py} +3 -3
  176. package/src/superlocalmemory/storage/migrations/M039_scene_fact_members.py +137 -0
  177. package/src/superlocalmemory/storage/migrations/__init__.py +4 -2
  178. package/src/superlocalmemory/storage/schema.py +67 -0
  179. package/src/superlocalmemory/storage/write_coordinator.py +125 -0
  180. package/src/superlocalmemory/trust/scorer.py +28 -4
  181. package/src/superlocalmemory/ui/index.html +14 -3
  182. package/src/superlocalmemory/ui/js/auto-settings.js +12 -1
  183. package/src/superlocalmemory/ui/js/brain.js +6 -4
  184. package/src/superlocalmemory/ui/js/compliance.js +66 -12
  185. package/src/superlocalmemory/ui/js/dashboard.js +13 -3
  186. package/src/superlocalmemory/ui/js/feedback.js +8 -2
  187. package/src/superlocalmemory/ui/js/lifecycle.js +7 -1
  188. package/src/superlocalmemory/ui/js/modal.js +272 -5
  189. package/src/superlocalmemory/ui/js/od-backup.js +9 -2
  190. package/src/superlocalmemory/ui/js/od-compliance-ext.js +301 -0
  191. package/src/superlocalmemory/ui/js/od-operations.js +154 -23
  192. package/src/superlocalmemory/ui/js/od-ops-health.js +417 -0
  193. package/src/superlocalmemory/ui/js/od-optimize.js +35 -21
  194. package/src/superlocalmemory/ui/js/od-team.js +9 -2
  195. package/src/superlocalmemory/ui/js/optimize.js +13 -16
  196. package/src/superlocalmemory/ui/js/profiles.js +7 -3
  197. package/src/superlocalmemory/ui/js/settings.js +7 -1
  198. package/src/superlocalmemory/vector/lancedb_backend.py +19 -9
  199. package/src/superlocalmemory/attribution/mathematical_dna.py +0 -235
  200. package/src/superlocalmemory/cli/post_install.py +0 -114
  201. package/src/superlocalmemory/core/clock_monitor.py +0 -45
  202. package/src/superlocalmemory/core/db_pool.py +0 -80
  203. package/src/superlocalmemory/core/error_catalog.py +0 -113
  204. package/src/superlocalmemory/core/loop_watchdog.py +0 -56
  205. package/src/superlocalmemory/core/priority_queue.py +0 -61
  206. package/src/superlocalmemory/core/pruning_engine.py +0 -216
  207. package/src/superlocalmemory/core/queue_dispatcher.py +0 -73
  208. package/src/superlocalmemory/core/slmignore.py +0 -125
  209. package/src/superlocalmemory/infra/heartbeat_monitor.py +0 -140
  210. package/src/superlocalmemory/infra/webhook_dispatcher.py +0 -247
  211. package/src/superlocalmemory/learning/quantization_scheduler.py +0 -320
  212. package/src/superlocalmemory/storage/access_control.py +0 -182
@@ -1,5 +1,5 @@
1
1
  # pi.dev Integration
2
- > SuperLocalMemory V3 Documentation
2
+ > SuperLocalMemory V4 Documentation
3
3
  > https://superlocalmemory.com | Part of Qualixar
4
4
 
5
5
  pi.dev can connect to SuperLocalMemory through the standard stdio MCP
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "superlocalmemory",
3
- "version": "3.8.13",
3
+ "version": "4.0.0",
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",
@@ -81,9 +81,14 @@
81
81
  "plugin/",
82
82
  "plugin-src/skills/slm-cache/SKILL.md",
83
83
  "plugin-src/skills/slm-compress/SKILL.md",
84
+ "plugin-src/skills/slm-governance/SKILL.md",
84
85
  "plugin-src/skills/slm-graph/SKILL.md",
86
+ "plugin-src/skills/slm-loop/SKILL.md",
87
+ "plugin-src/skills/slm-mesh/SKILL.md",
88
+ "plugin-src/skills/slm-profile/SKILL.md",
85
89
  "plugin-src/skills/slm-recall/SKILL.md",
86
90
  "plugin-src/skills/slm-remember/SKILL.md",
91
+ "plugin-src/skills/slm-scope/SKILL.md",
87
92
  "plugin-src/skills/slm-session/SKILL.md",
88
93
  "plugin-src/skills/slm-status/SKILL.md",
89
94
  "plugin-src/rules/AGENTS.md",
@@ -15,5 +15,5 @@
15
15
  "mcpServers": "./.mcp.json",
16
16
  "name": "superlocalmemory",
17
17
  "repository": "https://github.com/qualixar/superlocalmemory",
18
- "version": "3.8.13"
18
+ "version": "4.0.0"
19
19
  }
package/plugin/CLAUDE.md CHANGED
@@ -1,4 +1,4 @@
1
- <!-- BEGIN SuperLocalMemory v3.8.13 -->
1
+ <!-- BEGIN SuperLocalMemory v4.0.0 -->
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 v3.8.13 -->
42
+ <!-- END SuperLocalMemory v4.0.0 -->
43
43
 
44
- SuperLocalMemory v3.8.13 · Qualixar · AGPL-3.0-or-later
44
+ SuperLocalMemory v4.0.0 · 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 v3.8.13 · Qualixar · AGPL-3.0-or-later
80
+ SuperLocalMemory v4.0.0 · Qualixar · AGPL-3.0-or-later
@@ -68,4 +68,4 @@ assessment. The gate is the authority.
68
68
 
69
69
  ---
70
70
 
71
- SuperLocalMemory v3.8.13 · Qualixar · AGPL-3.0-or-later
71
+ SuperLocalMemory v4.0.0 · 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 v3.8.13 · Qualixar · AGPL-3.0-or-later
49
+ SuperLocalMemory v4.0.0 · 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 v3.8.13 · Qualixar · AGPL-3.0-or-later
44
+ SuperLocalMemory v4.0.0 · Qualixar · AGPL-3.0-or-later
@@ -1 +1 @@
1
- superlocalmemory==3.8.13
1
+ superlocalmemory==4.0.0
@@ -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 v3.8.13 · Qualixar · AGPL-3.0-or-later
148
+ SuperLocalMemory v4.0.0 · 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 v3.8.13 · Qualixar · AGPL-3.0-or-later
150
+ SuperLocalMemory v4.0.0 · 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 v3.8.13 · Qualixar · AGPL-3.0-or-later*
248
+ *SuperLocalMemory v4.0.0 · 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 v3.8.13 · Qualixar · AGPL-3.0-or-later
314
+ SuperLocalMemory v4.0.0 · 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 v3.8.13 · Qualixar · AGPL-3.0-or-later
99
+ SuperLocalMemory v4.0.0 · Qualixar · AGPL-3.0-or-later
@@ -279,4 +279,4 @@ mesh availability.
279
279
 
280
280
  ---
281
281
 
282
- *SuperLocalMemory v3.8.13 · Qualixar · AGPL-3.0-or-later*
282
+ *SuperLocalMemory v4.0.0 · Qualixar · AGPL-3.0-or-later*
@@ -145,4 +145,4 @@ Name them differently in your MCP config (e.g. `superlocalmemory-personal` and
145
145
 
146
146
  ---
147
147
 
148
- *SuperLocalMemory v3.8.13 · Qualixar · AGPL-3.0-or-later*
148
+ *SuperLocalMemory v4.0.0 · 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 v3.8.13 · Qualixar · AGPL-3.0-or-later*
239
+ *SuperLocalMemory v4.0.0 · 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 v3.8.13 · Qualixar · AGPL-3.0-or-later*
241
+ *SuperLocalMemory v4.0.0 · 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 v3.8.13 · Qualixar · AGPL-3.0-or-later*
176
+ *SuperLocalMemory v4.0.0 · 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 v3.8.13 · Qualixar · AGPL-3.0-or-later*
230
+ *SuperLocalMemory v4.0.0 · 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 v3.8.13 · Qualixar · AGPL-3.0-or-later
166
+ SuperLocalMemory v4.0.0 · Qualixar · AGPL-3.0-or-later
@@ -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 v3.8.13 · Qualixar · AGPL-3.0-or-later
131
+ SuperLocalMemory v4.0.0 · 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 v3.8.13 · Qualixar · AGPL-3.0-or-later
148
+ SuperLocalMemory v4.0.0 · 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 v3.8.13 · Qualixar · AGPL-3.0-or-later
150
+ SuperLocalMemory v4.0.0 · Qualixar · AGPL-3.0-or-later
@@ -0,0 +1,248 @@
1
+ ---
2
+ name: slm-governance
3
+ description: Enterprise compliance and governed workspace behavior for SuperLocalMemory. Covers role-based access (admin/member/viewer), retention policies, audit trail, GDPR data export/erase, and how agents must behave when operating under workspace governance. Requires power MCP profile for audit/retention tools. Agents must never bypass governance controls.
4
+ when_to_use: |
5
+ - "What can I do in this workspace?" (role check)
6
+ - "Set a 90-day retention policy on this memory"
7
+ - "Show the audit trail for recent memory operations"
8
+ - "Export my data for GDPR compliance"
9
+ - "Delete all memories for user X (right to erasure)"
10
+ - "Configure require-login for this workspace"
11
+ - Enterprise deployment with multi-team shared SLM
12
+ - Compliance, audit, or data governance task
13
+ allowed-tools: audit_trail, set_retention_policy, get_retention_stats, get_lifecycle_status, recall, search, remember, Bash
14
+ ---
15
+
16
+ # slm-governance — Enterprise Compliance and Governed Workspace Behavior
17
+
18
+ SuperLocalMemory supports enterprise deployments with role-based access control,
19
+ retention policies, audit logging, and GDPR compliance tooling. This skill
20
+ documents how agents must behave when operating in a governed workspace and how
21
+ to use the governance MCP tools (available in the `power` profile).
22
+
23
+ ---
24
+
25
+ ## Role model
26
+
27
+ Governed workspaces have three roles:
28
+
29
+ | Role | Read | Write personal | Write shared/global | Admin operations |
30
+ |------|------|---------------|---------------------|-----------------|
31
+ | `viewer` | Yes | No | No | No |
32
+ | `member` | Yes | Yes | Yes (within access list) | No |
33
+ | `admin` | Yes | Yes | Yes (unrestricted) | Yes |
34
+
35
+ **Agent behavior by role:**
36
+
37
+ - **Viewer**: Only call `recall`, `search`, `fetch`, `list_recent`. Never call
38
+ `remember`, `update_memory`, `forget`, or any write tool. If a write is
39
+ attempted, fail gracefully: "This workspace is read-only in viewer mode."
40
+ - **Member**: May write personal facts and shared facts with permitted profiles.
41
+ May NOT write `scope="global"` facts without explicit admin authorization.
42
+ May NOT call `set_retention_policy`, `audit_trail`, or `compact_memories`.
43
+ - **Admin**: Full access including governance tools in the `power` profile.
44
+
45
+ An agent operating in a governed workspace must check its role before any write
46
+ operation. Role information is visible in workspace configuration or via
47
+ `slm status --json` (the `role` field, if present).
48
+
49
+ ---
50
+
51
+ ## Retention policies
52
+
53
+ Retention policies control how long facts are stored before they become eligible
54
+ for decay. Available in the `power` MCP profile.
55
+
56
+ ### Set a retention policy
57
+
58
+ ```
59
+ set_retention_policy(
60
+ profile_id: str = "", # "" = active profile
61
+ days: int = 90, # facts older than this become decay-eligible
62
+ zone: str = "default", # retention zone name
63
+ )
64
+ ```
65
+
66
+ Retention zones let you apply different policies to different fact categories:
67
+
68
+ ```
69
+ # Standard facts: 90-day retention
70
+ set_retention_policy(profile_id="", days=90, zone="default")
71
+
72
+ # Security findings: 365-day retention (compliance requirement)
73
+ set_retention_policy(profile_id="", days=365, zone="security")
74
+ ```
75
+
76
+ Tag your facts with the zone name to route them to the right policy:
77
+ ```
78
+ remember(content="Critical auth bypass in v2.1", tags="security,cve,finding", ...)
79
+ ```
80
+
81
+ ### Check retention statistics
82
+
83
+ ```
84
+ get_retention_stats()
85
+ ```
86
+
87
+ Returns zone distribution, average fact age, and decay-eligible counts. Use this
88
+ to verify policies are working as expected.
89
+
90
+ ### Check lifecycle status
91
+
92
+ ```
93
+ get_lifecycle_status()
94
+ ```
95
+
96
+ Reports the state of the retention and decay subsystem — whether decay cycles are
97
+ running, when the next cycle runs, and any backlog.
98
+
99
+ ---
100
+
101
+ ## Audit trail
102
+
103
+ `audit_trail` is available in the `power` profile. It returns a structured log of
104
+ recent memory operations (writes, reads, profile switches, policy changes).
105
+
106
+ ```
107
+ audit_trail(
108
+ limit: int = 50, # number of entries to return
109
+ operation: str = "", # filter by operation type (e.g. "remember", "forget")
110
+ profile_id: str = "", # filter by profile; "" = active profile
111
+ )
112
+ ```
113
+
114
+ Use this for:
115
+ - Compliance reviews ("what data was written in the last 30 days?")
116
+ - Investigating unexpected memory changes
117
+ - Generating audit reports for data controllers
118
+
119
+ The audit trail covers MCP and CLI operations. It does not record the content of
120
+ facts by default — only operation type, timestamp, agent ID, and fact ID.
121
+
122
+ ---
123
+
124
+ ## GDPR compliance
125
+
126
+ ### Data export
127
+
128
+ SLM does not have a dedicated MCP export tool. For GDPR data subject access
129
+ requests, use the CLI:
130
+
131
+ ```bash
132
+ # Export all memories in a profile to JSON
133
+ slm status --json # confirm active profile
134
+ slm list --limit 9999 --json > export.json
135
+ ```
136
+
137
+ For a complete export including entity graph data, run:
138
+ ```bash
139
+ slm status --json
140
+ ```
141
+
142
+ Contact your workspace admin to arrange a full database-level export if the CLI
143
+ output is insufficient for compliance purposes.
144
+
145
+ ### Right to erasure
146
+
147
+ To erase all memories for a subject or project:
148
+
149
+ ```bash
150
+ # Step 1: preview what will be deleted (ALWAYS do this first)
151
+ slm forget "<subject or project name>" --dry-run --json
152
+
153
+ # Step 2: review the preview, then execute
154
+ slm forget "<subject or project name>" --yes --json
155
+ ```
156
+
157
+ For targeted deletion by fact ID:
158
+ ```bash
159
+ slm delete <fact_id> --yes --json
160
+ ```
161
+
162
+ For data reconstruction prevention: after erasure, confirm the fact is gone by
163
+ running `slm recall "<content>"`. A successful erasure returns no results. Never
164
+ attempt to re-derive erased content from other stored facts.
165
+
166
+ ---
167
+
168
+ ## require-login
169
+
170
+ When `require_login` is enabled in workspace configuration, agents must
171
+ authenticate before any memory operation. SLM handles authentication at the
172
+ daemon level — agents do not need to pass credentials in tool calls. If an
173
+ agent receives an authentication error from any MCP tool, it must:
174
+
175
+ 1. Stop the current operation immediately.
176
+ 2. Report the authentication requirement to the user.
177
+ 3. Never cache, retry, or work around the authentication block.
178
+
179
+ ---
180
+
181
+ ## Scope enforcement in governed workspaces
182
+
183
+ In a governed workspace, scope restrictions are enforced server-side:
184
+ - **Viewers** cannot write any fact regardless of `scope` parameter.
185
+ - **Members** cannot write `scope="global"` unless their access list includes
186
+ the global scope — attempts return a permission error.
187
+ - **Admins** can write any scope.
188
+
189
+ Agents must not attempt to work around scope restrictions by splitting a global
190
+ fact into multiple shared facts to accumulate equivalent visibility.
191
+
192
+ ---
193
+
194
+ ## Compact memories (admin-only)
195
+
196
+ `compact_memories` deduplicates and consolidates stored memories. This is an
197
+ admin operation — it can change fact IDs and remove content.
198
+
199
+ ```
200
+ compact_memories(
201
+ profile_id: str = "", # "" = active profile
202
+ dry_run: bool = True, # ALWAYS true first — inspect before running
203
+ )
204
+ ```
205
+
206
+ Always run with `dry_run=True` first and review the impact report. Never run
207
+ compaction without admin authorization.
208
+
209
+ ---
210
+
211
+ ## Consistency check (admin-only)
212
+
213
+ ```
214
+ consistency_check(profile_id: str = "")
215
+ ```
216
+
217
+ Verifies data integrity of the memory store — checks for orphaned entities,
218
+ broken references, and index-database mismatches. Use after migrations or
219
+ unexpected shutdowns. Returns a structured report.
220
+
221
+ ---
222
+
223
+ ## Agent checklist for governed workspaces
224
+
225
+ Before each write operation:
226
+ - [ ] Confirm my role allows writes (viewer → skip; member/admin → proceed)
227
+ - [ ] Confirm scope is appropriate for my role (member → no global)
228
+ - [ ] Set correct tags including zone name if retention policy applies
229
+ - [ ] Pass `session_id` for full audit attribution
230
+
231
+ Before running any destructive operation (`forget`, `compact_memories`):
232
+ - [ ] Admin authorization confirmed
233
+ - [ ] Ran with `dry_run=True` and reviewed output
234
+ - [ ] GDPR: confirmed the subject or controller authorized the erasure
235
+
236
+ ---
237
+
238
+ ## Related skills
239
+
240
+ - `slm-scope` — scope model details (personal/shared/global)
241
+ - `slm-profile` — workspace isolation and profile switching
242
+ - `slm-remember` — fact storage reference (includes scope parameters)
243
+ - `slm-recall` — retrieval reference (includes scope read flags)
244
+ - `slm-mesh` — mesh tools (full/power profiles)
245
+
246
+ ---
247
+
248
+ *SuperLocalMemory v4.0.0 · 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 v3.8.13 · Qualixar · AGPL-3.0-or-later
314
+ SuperLocalMemory v4.0.0 · Qualixar · AGPL-3.0-or-later
@@ -0,0 +1,99 @@
1
+ ---
2
+ name: slm-loop
3
+ description: Run gate-verified bounded loops with SuperLocalMemory as the durable ledger. Use when a task has a checkable acceptance condition (tests, schema, lint, reconciliation) and you must iterate until an INDEPENDENT gate passes — never stopping just because the agent believes it is done. `slm loop demo` runs a keyless convergence demo; `slm loop history` and `slm loop show <run_id>` inspect past runs whose every lap is persisted as queryable SLM memory (tag `loop:<name>`). Terminal statuses are DONE / HALT / PAUSE / KILLED / ERROR — report them exactly, never converting HALT/PAUSE/ERROR into success.
4
+ when_to_use: "run a bounded loop, gate-verified task, iterate until tests pass, verify against an independent gate, don't trust the agent's own done claim, slm loop, convergence loop, loop until green, loop ledger, resume a loop"
5
+ allowed-tools: Bash, slm_recall
6
+ ---
7
+
8
+ # slm-loop — Bounded, gate-verified agent loops
9
+
10
+ ## The one rule
11
+
12
+ A bounded loop is complete **only when an independent gate passes** — not when
13
+ the agent claims it is finished. The agent's own "I'm done" signal is recorded
14
+ for audit and is *never* used to terminate the loop. If you take one thing from
15
+ this skill: **the gate is the authority.**
16
+
17
+ Use a bounded loop whenever the goal has a mechanical, checkable contract: a
18
+ test suite, a JSON schema, a linter, a reconciliation rule, a citation checker,
19
+ a security scan. When the goal is subjective, keep a human approval gate (see
20
+ rungs below).
21
+
22
+ ## What SLM adds
23
+
24
+ Every lap is written to SuperLocalMemory as a durable, queryable memory (tagged
25
+ `loop:<name>`, session `loop:<run_id>`). That makes a run:
26
+
27
+ - **auditable** — inspect the decision + gate verdict + budget for each lap;
28
+ - **resumable / historical** — a run's ledger survives across sessions;
29
+ - **discoverable** — visible via `slm recall`, the dashboard, and any
30
+ SLM-integrated tool, alongside everything else the agent remembers.
31
+
32
+ ## CLI
33
+
34
+ ```bash
35
+ slm loop demo [--iterations N] [--json] # keyless convergence demo
36
+ slm loop history [--name NAME] [--json] # list recorded runs
37
+ slm loop show <run_id> [--json] # every lap of one run
38
+ ```
39
+
40
+ `slm loop demo` proposes a fix, checks it against a deterministic gate that
41
+ passes on lap 3, and records the run — a zero-setup way to see the control flow
42
+ and confirm the SLM-backed ledger works end to end.
43
+
44
+ ## The bounds
45
+
46
+ A loop runs inside a safety envelope. Any bound tripping ends the run with
47
+ `HALT` (never a success):
48
+
49
+ - **max_iterations** — a hard lap cap.
50
+ - **no_progress_window** — consecutive no-change laps before halting a spinning
51
+ agent.
52
+ - **token budget / wall-clock** — cumulative ceilings.
53
+ - **kill switch** — set `SLM_LOOP_KILL` to stop before the next lap.
54
+ - **approval rung** — L1 (report), L2 (assisted, pauses for approval), L3
55
+ (unattended). L2/L3 require approval before a passing gate is accepted as
56
+ DONE unless approval is explicitly configured off.
57
+
58
+ ## Terminal statuses — report exactly
59
+
60
+ | Status | Meaning |
61
+ |----------|---------|
62
+ | `DONE` | The independent gate passed **and** approval was granted or not required. |
63
+ | `HALT` | A bound tripped (iterations, no-progress, token, or wall-clock). |
64
+ | `PAUSE` | The gate passed but required approval is not yet granted. |
65
+ | `KILLED` | The external kill switch tripped between laps. |
66
+ | `ERROR` | The runner or gate failed to execute; inspect the lap detail. |
67
+
68
+ Say `DONE` only when the status is exactly `DONE`. Never describe `HALT`,
69
+ `PAUSE`, or `ERROR` as success. When halted, name which bound tripped; when
70
+ paused, name the approval needed; when errored, quote the short detail.
71
+
72
+ ## Reporting workflow
73
+
74
+ 1. Run or resume the loop.
75
+ 2. Read back the ledger with `slm loop show <run_id>` (or `slm recall` on tag
76
+ `loop:<name>`).
77
+ 3. Report the exact terminal status, the lap count, and the gate's final
78
+ verdict. Include the `run_id` so the run can be re-inspected later.
79
+
80
+ ## Gate discipline
81
+
82
+ - The gate verifies; the runner only proposes. They are separate.
83
+ - Prefer a typed, parseable gate (a test exit code, a schema validation, a
84
+ scanner report) over a vague check. A missing tool, an empty report, or a
85
+ crashed scanner is **not** a clean pass — fail closed.
86
+ - Never use "an LLM decides it looks good" as the gate. That reintroduces the
87
+ exact failure mode bounded loops exist to remove.
88
+
89
+ ---
90
+
91
+ ## Related skills
92
+
93
+ - `slm-status` — confirm SLM is healthy before relying on the ledger.
94
+ - `slm-recall` — query a loop's laps directly (`loop:<name>` tag).
95
+ - `slm-session` — session lifecycle around a longer loop run.
96
+
97
+ ---
98
+
99
+ SuperLocalMemory v4.0.0 · Qualixar · AGPL-3.0-or-later