superlocalmemory 4.1.21 → 4.1.23

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 (179) hide show
  1. package/.claude-plugin/marketplace.json +3 -3
  2. package/CHANGELOG.md +210 -0
  3. package/README.md +101 -33
  4. package/antigravity-plugin/_GENERATED.md +33 -0
  5. package/antigravity-plugin/agents/slm-governance-advisor.md +78 -0
  6. package/antigravity-plugin/agents/slm-loop-runner.md +82 -0
  7. package/antigravity-plugin/agents/slm-memory-advisor.md +50 -0
  8. package/antigravity-plugin/agents/slm-optimize-advisor.md +44 -0
  9. package/antigravity-plugin/commands/slm-loop.md +33 -0
  10. package/antigravity-plugin/hooks/hooks.json +59 -0
  11. package/antigravity-plugin/hooks.json +42 -0
  12. package/antigravity-plugin/mcp_config.json +14 -0
  13. package/antigravity-plugin/plugin.json +25 -0
  14. package/antigravity-plugin/scripts/antigravity_hook_adapter.py +85 -0
  15. package/antigravity-plugin/skills/slm-bot-memory/SKILL.md +146 -0
  16. package/antigravity-plugin/skills/slm-cache/SKILL.md +147 -0
  17. package/antigravity-plugin/skills/slm-compress/SKILL.md +150 -0
  18. package/antigravity-plugin/skills/slm-getting-started-bot/SKILL.md +146 -0
  19. package/antigravity-plugin/skills/slm-governance/SKILL.md +221 -0
  20. package/antigravity-plugin/skills/slm-graph/SKILL.md +327 -0
  21. package/antigravity-plugin/skills/slm-loop/SKILL.md +153 -0
  22. package/antigravity-plugin/skills/slm-mesh/SKILL.md +287 -0
  23. package/antigravity-plugin/skills/slm-profile/SKILL.md +159 -0
  24. package/antigravity-plugin/skills/slm-recall/SKILL.md +430 -0
  25. package/antigravity-plugin/skills/slm-remember/SKILL.md +370 -0
  26. package/antigravity-plugin/skills/slm-scope/SKILL.md +183 -0
  27. package/antigravity-plugin/skills/slm-session/SKILL.md +291 -0
  28. package/antigravity-plugin/skills/slm-status/SKILL.md +185 -0
  29. package/antigravity-plugin/skills/slm-web-access/SKILL.md +91 -0
  30. package/codex-plugin/.claude-plugin/plugin.json +19 -0
  31. package/codex-plugin/.codex/config.toml +40 -0
  32. package/codex-plugin/.codex-plugin/plugin.json +43 -0
  33. package/codex-plugin/.mcp.json +16 -0
  34. package/codex-plugin/AGENTS.md +161 -0
  35. package/codex-plugin/README.md +205 -0
  36. package/codex-plugin/_GENERATED.md +52 -0
  37. package/codex-plugin/agents/slm-governance-advisor.md +78 -0
  38. package/codex-plugin/agents/slm-loop-runner.md +82 -0
  39. package/codex-plugin/agents/slm-memory-advisor.md +50 -0
  40. package/codex-plugin/agents/slm-optimize-advisor.md +44 -0
  41. package/codex-plugin/commands/slm-loop.md +33 -0
  42. package/codex-plugin/hooks/hooks.json +59 -0
  43. package/codex-plugin/scripts/ensure-venv.bat +108 -0
  44. package/codex-plugin/scripts/ensure-venv.sh +100 -0
  45. package/codex-plugin/scripts/slm-launch +55 -0
  46. package/codex-plugin/scripts/slm-launch.bat +30 -0
  47. package/codex-plugin/skills/slm-bot-memory/SKILL.md +146 -0
  48. package/codex-plugin/skills/slm-cache/SKILL.md +147 -0
  49. package/codex-plugin/skills/slm-compress/SKILL.md +150 -0
  50. package/codex-plugin/skills/slm-getting-started-bot/SKILL.md +146 -0
  51. package/codex-plugin/skills/slm-governance/SKILL.md +221 -0
  52. package/codex-plugin/skills/slm-graph/SKILL.md +327 -0
  53. package/codex-plugin/skills/slm-loop/SKILL.md +153 -0
  54. package/codex-plugin/skills/slm-mesh/SKILL.md +287 -0
  55. package/codex-plugin/skills/slm-profile/SKILL.md +159 -0
  56. package/codex-plugin/skills/slm-recall/SKILL.md +430 -0
  57. package/codex-plugin/skills/slm-remember/SKILL.md +370 -0
  58. package/codex-plugin/skills/slm-scope/SKILL.md +183 -0
  59. package/codex-plugin/skills/slm-session/SKILL.md +291 -0
  60. package/codex-plugin/skills/slm-status/SKILL.md +185 -0
  61. package/codex-plugin/skills/slm-web-access/SKILL.md +91 -0
  62. package/copilot-plugin/.github/agents/slm-governance-advisor.agent.md +80 -0
  63. package/copilot-plugin/.github/agents/slm-loop-runner.agent.md +84 -0
  64. package/copilot-plugin/.github/agents/slm-memory-advisor.agent.md +52 -0
  65. package/copilot-plugin/.github/agents/slm-optimize-advisor.agent.md +46 -0
  66. package/copilot-plugin/.github/copilot-instructions.md +52 -0
  67. package/copilot-plugin/.github/hooks/slm-hooks.json +44 -0
  68. package/copilot-plugin/.github/prompts/slm-bot-memory.prompt.md +147 -0
  69. package/copilot-plugin/.github/prompts/slm-cache.prompt.md +151 -0
  70. package/copilot-plugin/.github/prompts/slm-compress.prompt.md +154 -0
  71. package/copilot-plugin/.github/prompts/slm-getting-started-bot.prompt.md +147 -0
  72. package/copilot-plugin/.github/prompts/slm-governance.prompt.md +224 -0
  73. package/copilot-plugin/.github/prompts/slm-graph.prompt.md +322 -0
  74. package/copilot-plugin/.github/prompts/slm-loop.prompt.md +159 -0
  75. package/copilot-plugin/.github/prompts/slm-mesh.prompt.md +290 -0
  76. package/copilot-plugin/.github/prompts/slm-profile.prompt.md +155 -0
  77. package/copilot-plugin/.github/prompts/slm-recall.prompt.md +434 -0
  78. package/copilot-plugin/.github/prompts/slm-remember.prompt.md +375 -0
  79. package/copilot-plugin/.github/prompts/slm-scope.prompt.md +183 -0
  80. package/copilot-plugin/.github/prompts/slm-session.prompt.md +291 -0
  81. package/copilot-plugin/.github/prompts/slm-status.prompt.md +190 -0
  82. package/copilot-plugin/.github/prompts/slm-web-access.prompt.md +95 -0
  83. package/copilot-plugin/.vscode/mcp.json +11 -0
  84. package/copilot-plugin/README.md +26 -0
  85. package/copilot-plugin/_GENERATED.md +49 -0
  86. package/copilot-plugin/scripts/ensure-venv.bat +122 -0
  87. package/copilot-plugin/scripts/ensure-venv.sh +169 -0
  88. package/copilot-plugin/scripts/slm-launch +207 -0
  89. package/copilot-plugin/scripts/slm-launch.bat +32 -0
  90. package/copilot-plugin/scripts/slm-resolve.sh +128 -0
  91. package/copilot-plugin/scripts/slm-run +76 -0
  92. package/copilot-plugin/scripts/torch-cpu-resolve.sh +86 -0
  93. package/docs/pi-dev-integration.md +0 -2
  94. package/hermes-plugin/README.md +30 -0
  95. package/hermes-plugin/_GENERATED.md +3 -0
  96. package/hermes-plugin/__init__.py +417 -0
  97. package/hermes-plugin/agents/slm-governance-advisor.md +78 -0
  98. package/hermes-plugin/agents/slm-loop-runner.md +82 -0
  99. package/hermes-plugin/agents/slm-memory-advisor.md +50 -0
  100. package/hermes-plugin/agents/slm-optimize-advisor.md +44 -0
  101. package/hermes-plugin/command-inventory.json +7 -0
  102. package/hermes-plugin/plugin.yaml +24 -0
  103. package/hermes-plugin/remote.py +390 -0
  104. package/hermes-plugin/skills/slm-bot-memory/SKILL.md +146 -0
  105. package/hermes-plugin/skills/slm-cache/SKILL.md +147 -0
  106. package/hermes-plugin/skills/slm-compress/SKILL.md +150 -0
  107. package/hermes-plugin/skills/slm-getting-started-bot/SKILL.md +146 -0
  108. package/hermes-plugin/skills/slm-governance/SKILL.md +221 -0
  109. package/hermes-plugin/skills/slm-graph/SKILL.md +327 -0
  110. package/hermes-plugin/skills/slm-loop/SKILL.md +153 -0
  111. package/hermes-plugin/skills/slm-mesh/SKILL.md +287 -0
  112. package/hermes-plugin/skills/slm-profile/SKILL.md +159 -0
  113. package/hermes-plugin/skills/slm-recall/SKILL.md +430 -0
  114. package/hermes-plugin/skills/slm-remember/SKILL.md +370 -0
  115. package/hermes-plugin/skills/slm-scope/SKILL.md +183 -0
  116. package/hermes-plugin/skills/slm-session/SKILL.md +291 -0
  117. package/hermes-plugin/skills/slm-status/SKILL.md +185 -0
  118. package/hermes-plugin/skills/slm-web-access/SKILL.md +91 -0
  119. package/package.json +9 -16
  120. package/plugin/.claude-plugin/plugin.json +2 -2
  121. package/plugin/.cursor-plugin/plugin.json +24 -0
  122. package/plugin/CLAUDE.md +14 -12
  123. package/plugin/agents/slm-governance-advisor.md +14 -16
  124. package/plugin/agents/slm-loop-runner.md +22 -11
  125. package/plugin/agents/slm-memory-advisor.md +14 -14
  126. package/plugin/agents/slm-optimize-advisor.md +5 -5
  127. package/plugin/assets/logo.svg +36 -0
  128. package/plugin/commands/slm-loop.md +5 -3
  129. package/plugin/cursor-skills/slm-bot-memory/SKILL.md +146 -0
  130. package/plugin/cursor-skills/slm-getting-started-bot/SKILL.md +146 -0
  131. package/plugin/cursor-skills/slm-recall/SKILL.md +430 -0
  132. package/plugin/cursor-skills/slm-remember/SKILL.md +370 -0
  133. package/plugin/cursor-skills/slm-scope/SKILL.md +183 -0
  134. package/plugin/cursor-skills/slm-session/SKILL.md +291 -0
  135. package/plugin/hooks/hooks.json +9 -9
  136. package/plugin/mcp.cursor.json +23 -0
  137. package/plugin/requirements-cpu-torch.txt +13 -0
  138. package/plugin/requirements.txt +1 -1
  139. package/plugin/scripts/ensure-venv.sh +45 -3
  140. package/plugin/scripts/slm-launch +93 -9
  141. package/plugin/scripts/torch-cpu-resolve.sh +86 -0
  142. package/plugin/skills/slm-bot-memory/SKILL.md +146 -0
  143. package/plugin/skills/slm-cache/SKILL.md +6 -7
  144. package/plugin/skills/slm-compress/SKILL.md +3 -3
  145. package/plugin/skills/slm-getting-started-bot/SKILL.md +146 -0
  146. package/plugin/skills/slm-governance/SKILL.md +126 -153
  147. package/plugin/skills/slm-graph/SKILL.md +27 -15
  148. package/plugin/skills/slm-loop/SKILL.md +74 -20
  149. package/plugin/skills/slm-mesh/SKILL.md +17 -12
  150. package/plugin/skills/slm-profile/SKILL.md +101 -91
  151. package/plugin/skills/slm-recall/SKILL.md +151 -54
  152. package/plugin/skills/slm-remember/SKILL.md +132 -35
  153. package/plugin/skills/slm-scope/SKILL.md +24 -17
  154. package/plugin/skills/slm-session/SKILL.md +77 -57
  155. package/plugin/skills/slm-status/SKILL.md +54 -35
  156. package/plugin/skills/slm-web-access/SKILL.md +91 -0
  157. package/plugin-src/agents/slm-governance-advisor.md +78 -0
  158. package/plugin-src/agents/slm-loop-runner.md +82 -0
  159. package/plugin-src/agents/slm-memory-advisor.md +14 -14
  160. package/plugin-src/agents/slm-optimize-advisor.md +5 -5
  161. package/plugin-src/commands/slm-loop.md +33 -0
  162. package/plugin-src/rules/AGENTS.md +45 -36
  163. package/plugin-src/rules/CLAUDE.md.fragment +47 -0
  164. package/plugin-src/skills/slm-bot-memory/SKILL.md +146 -0
  165. package/plugin-src/skills/slm-cache/SKILL.md +6 -7
  166. package/plugin-src/skills/slm-compress/SKILL.md +3 -3
  167. package/plugin-src/skills/slm-getting-started-bot/SKILL.md +146 -0
  168. package/plugin-src/skills/slm-governance/SKILL.md +126 -153
  169. package/plugin-src/skills/slm-graph/SKILL.md +27 -15
  170. package/plugin-src/skills/slm-loop/SKILL.md +74 -20
  171. package/plugin-src/skills/slm-mesh/SKILL.md +17 -12
  172. package/plugin-src/skills/slm-profile/SKILL.md +101 -91
  173. package/plugin-src/skills/slm-recall/SKILL.md +151 -54
  174. package/plugin-src/skills/slm-remember/SKILL.md +132 -35
  175. package/plugin-src/skills/slm-scope/SKILL.md +24 -17
  176. package/plugin-src/skills/slm-session/SKILL.md +77 -57
  177. package/plugin-src/skills/slm-status/SKILL.md +54 -35
  178. package/plugin-src/skills/slm-web-access/SKILL.md +91 -0
  179. package/scripts/postinstall.js +107 -0
@@ -1,236 +1,208 @@
1
1
  ---
2
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.
3
+ description: Governed-workspace behavior for SuperLocalMemory. Covers roles (admin/member/viewer) and company mode, retention and lifecycle settings, the audit trail, GDPR export and erasure, and how agents must behave when operating under workspace governance. The audit and retention tools need the power MCP profile. Agents must never bypass governance controls.
4
4
  when_to_use: |
5
5
  - "What can I do in this workspace?" (role check)
6
- - "Set a 90-day retention policy on this memory"
6
+ - "Move cold memories to archive after 60 days"
7
7
  - "Show the audit trail for recent memory operations"
8
8
  - "Export my data for GDPR compliance"
9
- - "Delete all memories for user X (right to erasure)"
10
- - "Configure require-login for this workspace"
9
+ - "Delete all memories about user X (right to erasure)"
10
+ - "Turn on require-login for this workspace"
11
11
  - Enterprise deployment with multi-team shared SLM
12
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
13
+ allowed-tools: audit_trail, set_retention_policy, get_retention_stats, get_lifecycle_status, compact_memories, consistency_check, recall, search, remember, Bash
14
14
  ---
15
15
 
16
- # slm-governance — Enterprise Compliance and Governed Workspace Behavior
16
+ # slm-governance — Governed Workspace Behavior
17
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).
18
+ SuperLocalMemory can run with named users and roles per workspace (company
19
+ mode), keeps a compliance audit trail, applies a retention lifecycle, and ships
20
+ GDPR export and erasure commands. This skill documents how an agent must behave
21
+ in a governed workspace and what the governance tools really do. The MCP audit
22
+ and retention tools are in the `power` tool set (see `slm-profile`).
22
23
 
23
24
  ---
24
25
 
25
26
  ## Role model
26
27
 
27
- Governed workspaces have three roles:
28
+ By default SLM is single-user: whoever runs it is the owner and nothing asks for
29
+ a login. Company mode adds named users, each with one role per workspace
30
+ (profile). A role in one workspace grants nothing in another.
28
31
 
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 |
32
+ | Role | Read | Write | Share (`shared`/`global` writes) | Delete | Manage users and settings |
33
+ |------|------|-------|-------|--------|-----------------|
34
+ | `viewer` | Yes | No | No | No | No |
35
+ | `member` | Yes | Yes | Yes | No | No |
36
+ | `admin` | Yes | Yes | Yes | Yes | Yes |
34
37
 
35
38
  **Agent behavior by role:**
36
39
 
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.
40
+ - **Viewer**: Only call `recall`, `search`, `fetch`, `list_recent` and other
41
+ reads. Never call `remember`, `update_memory`, `delete_memory` or any write
42
+ tool. If a write is refused, say so: "This workspace is read-only for my role."
43
+ - **Member**: May write memories, including `scope="shared"` and `scope="global"`
44
+ when the user explicitly asks for them. May not delete memories or change
45
+ users, roles or settings.
46
+ - **Admin**: Everything above plus deletion and user administration.
44
47
 
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
+ No MCP tool or `slm` command reports your role (only a signed-in dashboard session can ask the daemon, at `GET /api/rbac/whoami`). Do not guess it: attempt
49
+ what the user asked and treat a permission refusal as final. Setting up users,
50
+ roles and "Require login" is done in the dashboard under **Settings → Access**;
51
+ there is no `slm user` or `slm role` command. The machine operator keeps user
52
+ administration in every mode so a mistake cannot lock everyone out.
48
53
 
49
54
  ---
50
55
 
51
- ## Retention policies
56
+ ## require-login
52
57
 
53
- Retention policies control how long facts are stored before they become eligible
54
- for decay. Available in the `power` MCP profile.
58
+ When login is required, every operation on memories needs a signed-in user,
59
+ including the connection your assistant uses. SLM handles this at the daemon
60
+ level; agents do not pass credentials in tool calls. If a tool call returns an
61
+ authentication or permission error, you must:
55
62
 
56
- ### Set a retention policy
63
+ 1. Stop the current operation immediately.
64
+ 2. Report the requirement to the user.
65
+ 3. Never cache, retry, or work around the block.
57
66
 
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
- ```
67
+ In this mode, `include_global=True` and `include_shared=True` on `recall` are
68
+ quietly turned off while the recall policy forbids cross-profile reads (the
69
+ default), so an opt-in recall can come back with only personal facts. Do not try
70
+ to work around it. See `slm-scope`.
65
71
 
66
- Retention zones let you apply different policies to different fact categories:
72
+ ---
67
73
 
68
- ```
69
- # Standard facts: 90-day retention
70
- set_retention_policy(profile_id="", days=90, zone="default")
74
+ ## Retention and lifecycle
71
75
 
72
- # Security findings: 365-day retention (compliance requirement)
73
- set_retention_policy(profile_id="", days=365, zone="security")
74
- ```
76
+ Every memory moves through lifecycle states as it goes unused: active, warm, cold,
77
+ archived. Two tools set and inspect that, and a third runs the forgetting cycle.
78
+ They need the `power` tool set.
79
+
80
+ ### Set the thresholds
75
81
 
76
- Tag your facts with the zone name to route them to the right policy:
77
82
  ```
78
- remember(content="Critical auth bypass in v2.1", tags="security,cve,finding", ...)
83
+ set_retention_policy(
84
+ cold_after_days: int = 30, # days of inactivity before a memory goes cold
85
+ archive_after_days: int = 90, # days before it is archived
86
+ )
79
87
  ```
80
88
 
81
- ### Check retention statistics
89
+ It sets two thresholds and returns them. There is no `profile_id` argument and
90
+ there are no named retention zones or per-tag policies; tagging a memory does not
91
+ route it to a different policy.
92
+
93
+ ### Look at the state
82
94
 
83
95
  ```
84
- get_retention_stats()
96
+ get_retention_stats(profile_id="")
97
+ get_lifecycle_status(limit=50, profile_id="")
85
98
  ```
86
99
 
87
- Returns zone distribution, average fact age, and decay-eligible counts. Use this
88
- to verify policies are working as expected.
100
+ `get_retention_stats` reports, from the retention table, the count and average
101
+ retention score per Ebbinghaus zone (`active`, `warm`, `cold`, `archive`,
102
+ `forgotten`) and the totals. `get_lifecycle_status` counts the active, warm, cold
103
+ and archived state of up to `limit` memories and returns up to ten short
104
+ samples of each. Neither says when the next cycle runs.
89
105
 
90
- ### Check lifecycle status
106
+ ### Apply it
91
107
 
92
108
  ```
93
- get_lifecycle_status()
109
+ forget(dry_run=True) # preview the decay cycle for the active profile
110
+ compact_memories(dry_run=True) # preview lifecycle-state transitions
94
111
  ```
95
112
 
96
- Reports the state of the retention and decay subsystem — whether decay cycles are
97
- running, when the next cycle runs, and any backlog.
113
+ The MCP `forget` tool is not a delete: it recomputes retention scores and moves
114
+ memories between zones. `compact_memories` moves memories whose lifecycle state
115
+ has become due (for example cold to archived); it does not merge duplicates. Both
116
+ default to a dry run. Run the preview first, show it to the user, and only then
117
+ pass `dry_run=False`. Do not run either without the user's say-so.
98
118
 
99
119
  ---
100
120
 
101
121
  ## Audit trail
102
122
 
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
123
  ```
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
- )
124
+ audit_trail(limit: int = 50)
112
125
  ```
113
126
 
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
127
+ Returns the newest `limit` rows of the compliance audit for the active profile,
128
+ as `{"success", "entries", "count"}`. Each entry has `audit_id`, `profile_id`,
129
+ `action`, `target_type`, `target_id`, `details` and `timestamp`. There are no
130
+ filter arguments. Entries are compliance actions (store, retrieve, delete, export
131
+ and the like).
118
132
 
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.
133
+ Use it for compliance reviews, for investigating an unexpected change, and for
134
+ audit reports to a data controller.
121
135
 
122
136
  ---
123
137
 
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:
138
+ ## GDPR
130
139
 
131
140
  ```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
141
+ slm gdpr status [--profile P] [--json] # posture: receipts, audit counts, known gaps; read-only
142
+ slm gdpr export --profile P [--output FILE] [--json] # Art. 15/20 access and portability
143
+ slm gdpr erase --profile P --dry-run [--json] # preview an erasure
144
+ slm gdpr erase --profile P --yes [--json] # Art. 17 erasure, IRREVERSIBLE
145
+ slm gdpr verify --receipt-id ID [--profile P] # check an erasure receipt (exit 0 ok, 1 tampered, 2 not found)
135
146
  ```
136
147
 
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
148
+ `slm gdpr erase` erases a **profile**. It refuses to run without both `--profile`
149
+ and `--yes`, and without them it only previews. It is the only irreversible
150
+ operation here, so confirm the subject, the profile and the authority to erase
151
+ with the user before running it. `slm gdpr status` lists the known gaps (for
152
+ example backups and the code graph) rather than claiming completeness.
146
153
 
147
- To erase all memories for a subject or project:
154
+ To remove individual memories rather than a whole profile, use the deletion
155
+ commands from `slm-remember`:
148
156
 
149
157
  ```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
158
+ slm forget "<subject or project name>" --dry-run --json # ALWAYS first
154
159
  slm forget "<subject or project name>" --yes --json
155
- ```
156
-
157
- For targeted deletion by fact ID:
158
- ```bash
159
160
  slm delete <fact_id> --yes --json
160
161
  ```
161
162
 
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.
163
+ Memories that belong to a reviewed correction cannot be deleted this way; the
164
+ refusal names the case. After an erasure, confirm with `slm recall "<content>"`
165
+ that nothing comes back, and never try to re-derive erased content from other
166
+ stored facts.
178
167
 
179
168
  ---
180
169
 
181
170
  ## Scope enforcement in governed workspaces
182
171
 
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.
172
+ - **Viewers** cannot write anything, whatever the `scope` argument.
173
+ - **Members and admins** can write `shared` and `global` facts; writing either
174
+ scope needs the share permission, which both roles hold.
175
+ - Agents must not split a `global` fact into several `shared` facts, or otherwise
176
+ accumulate visibility the user did not ask for.
208
177
 
209
178
  ---
210
179
 
211
- ## Consistency check (admin-only)
180
+ ## Integrity checks
212
181
 
213
182
  ```
214
- consistency_check(profile_id: str = "")
183
+ consistency_check(limit: int = 100)
215
184
  ```
216
185
 
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.
186
+ Runs a sheaf-consistency check over up to `limit` memories and returns pairs of
187
+ facts that contradict each other, with a severity (`fact_a`, `fact_b`,
188
+ `severity`, `content_a`), plus `facts_checked`, `facts_errored` and
189
+ `total_contradictions`. If the checker is disabled it says so in `note`. For the
190
+ health of the store itself (orphan rows, erased words left behind, unfinished
191
+ deletes) use `slm db integrity` and `slm db repair`; see `slm-status`.
220
192
 
221
193
  ---
222
194
 
223
195
  ## Agent checklist for governed workspaces
224
196
 
225
197
  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
198
+ - [ ] The user asked for it, and a refusal from the workspace is respected
199
+ - [ ] Scope is `personal` unless the user explicitly asked to share
200
+ - [ ] Pass `session_id` so the write is attributed
201
+
202
+ Before running any destructive or state-changing operation (`forget`,
203
+ `compact_memories`, `slm forget --yes`, `slm gdpr erase --yes`):
204
+ - [ ] The user authorized it in this conversation
205
+ - [ ] Ran the dry run or preview and showed it to the user
234
206
  - [ ] GDPR: confirmed the subject or controller authorized the erasure
235
207
 
236
208
  ---
@@ -238,11 +210,12 @@ Before running any destructive operation (`forget`, `compact_memories`):
238
210
  ## Related skills
239
211
 
240
212
  - `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)
213
+ - `slm-profile` — memory profiles and tool sets
214
+ - `slm-remember` — fact storage, corrections and deletion
243
215
  - `slm-recall` — retrieval reference (includes scope read flags)
244
- - `slm-mesh` — mesh tools (full/power profiles)
216
+ - `slm-mesh` — mesh tools
217
+ - To use this memory from a web assistant or another computer, see the slm-web-access skill.
245
218
 
246
219
  ---
247
220
 
248
- *SuperLocalMemory v4.1.21 · Qualixar · AGPL-3.0-or-later*
221
+ *SuperLocalMemory v4.1.23 · Qualixar · AGPL-3.0-or-later*
@@ -20,7 +20,7 @@ allowed-tools: build_code_graph, query_graph, get_blast_radius, semantic_search_
20
20
 
21
21
  # slm-graph — Code Intelligence Skill
22
22
 
23
- Index any repo as a code knowledge graph and answer structural questions about it: callers, callees, impact radius, semantic search, and review context. Requires the `code` MCP profile (set `SLM_MCP_PROFILE=code` in your plugin `.mcp.json`).
23
+ Index any repo as a code knowledge graph and answer structural questions about it: callers, callees, impact radius, semantic search, and review context. These tools are only registered in the `code` MCP tool set (or with `SLM_MCP_ALL_TOOLS=1`); see "Tool set requirement" below.
24
24
 
25
25
  **Prerequisite rule:** every tool except `build_code_graph` self-guards — if the graph is not built it returns `{"success": false, "error": "Code graph not built. Run build_code_graph first."}`. Always index first.
26
26
 
@@ -40,7 +40,7 @@ build_code_graph(
40
40
 
41
41
  Parses all supported source files, extracts functions/classes/imports, builds the call graph, detects execution flows, and identifies code communities. Replaces any previous index for the same repo.
42
42
 
43
- - `repo_path` — absolute path to the repository root. Must exist.
43
+ - `repo_path` — absolute path to the repository root. Must exist and sit under your home directory; a path outside it is refused with `Invalid repo_path`.
44
44
  - `languages` — comma-separated language filter, e.g. `"python,typescript"`. Empty string = index all supported languages.
45
45
  - `exclude_patterns` — comma-separated glob patterns to exclude, e.g. `"**/node_modules/**,**/.venv/**"`. Empty = no exclusions.
46
46
 
@@ -204,14 +204,14 @@ detect_changes(
204
204
 
205
205
  Runs `git diff` against `base`, maps the changed hunks to graph nodes, and returns a risk-scored list of changed functions, test gaps, and review priorities. Requires the repo to be a git repository.
206
206
 
207
- - `base` — git ref to diff against. Default `"HEAD~1"` (one commit back). Any valid git ref works: `"main"`, `"v3.6.13"`, a commit SHA, etc.
207
+ - `base` — git ref to diff against. Default `"HEAD~1"` (one commit back). Any valid git ref works: `"main"`, `"v1.4.0"`, a commit SHA, etc.
208
208
 
209
209
  ```
210
210
  # What changed in the last commit?
211
211
  detect_changes()
212
212
 
213
213
  # What changed since the release branch?
214
- detect_changes(base="release/v3.6.13")
214
+ detect_changes(base="release/1.4")
215
215
 
216
216
  # What changed relative to main?
217
217
  detect_changes(base="main")
@@ -277,16 +277,22 @@ All tools return `{"success": false, "error": "<message>"}` on failure — they
277
277
  | `Repository path does not exist: <path>` | Bad `repo_path` in build | Pass an absolute path that exists |
278
278
  | `Git not available or not a git repository: ...` | `detect_changes` needs git | Only works in git repos with git installed |
279
279
  | `Invalid pattern '...'` | Wrong `pattern` in `query_graph` | Use one of the 8 valid pattern strings |
280
- | `No node found matching '<target>'` | Target not in index | Rebuild or check the qualified name via `semantic_search_code` |
280
+ | `No node found matching '<target>'` | Target not in index. Returned as `success: true` with an empty `results` and this `message`, not as an error | Rebuild or check the qualified name via `semantic_search_code` |
281
+ | `Invalid repo_path: ...` | `repo_path` is outside your home directory | Index a repository under your home directory |
281
282
 
282
283
  If `build_code_graph` returns `files_parsed: 0`, no supported source files were found — check `repo_path` and `exclude_patterns`.
283
284
 
284
285
  ---
285
286
 
286
- ## Profile Requirement
287
+ ## Tool set requirement
287
288
 
288
- This skill uses graph tools that are only active under the `code` MCP profile
289
- (or `full` / `power`). Your plugin `.mcp.json` must include:
289
+ The six tools above are registered only when the MCP server runs the `code` tool
290
+ set, or with `SLM_MCP_ALL_TOOLS=1` / `SLM_MCP_PROFILE=whole`, or when
291
+ `SLM_MCP_TOOLS` names them. They are **not** in `core`, `full`, `power` or the
292
+ no-profile default that the Claude Code and Codex plugins use, so with those
293
+ settings the tools simply do not exist and a call fails as an unknown tool. The
294
+ tool set is read when the server starts: set it in the host's MCP config and
295
+ restart the host.
290
296
 
291
297
  ```json
292
298
  "env": {
@@ -295,21 +301,27 @@ This skill uses graph tools that are only active under the `code` MCP profile
295
301
  }
296
302
  ```
297
303
 
298
- Without this, the six graph tools are not registered and will appear as unknown
299
- tools. Run `slm status` to confirm the active profile.
304
+ `switch_profile` does not change the tool set; it changes the active memory
305
+ profile. See `slm-profile`. The `code` set leaves out the mesh and several
306
+ administration tools, so ask the user before changing their tool set.
300
307
 
301
- **Switching profiles at runtime (v3.8.0+):** Use `switch_profile("code")` via
302
- MCP to activate the code profile in a session that started with a different
303
- profile. See `slm-profile` for the full profile switching workflow.
308
+ With `SLM_MCP_ALL_TOOLS=1` more graph tools appear: `update_code_graph` (refresh
309
+ for `changed_files` without a full rebuild), `list_graph_stats`,
310
+ `get_architecture_overview`, `list_communities`, `get_community`, `list_flows`,
311
+ `get_flow`, `get_affected_flows`, `find_large_functions`, `enrich_blast_radius`,
312
+ `refactor_preview`, and the code-to-memory tools `link_memory_to_code`,
313
+ `code_memory_search`, `code_entity_history` and `code_stale_check`. The memory
314
+ links need `"bridge_enabled": true` in `code_graph_config.json` and a rebuild.
315
+ All are host-only: a remote caller cannot use them.
304
316
 
305
317
  ---
306
318
 
307
319
  ## Related skills
308
320
 
309
- - `slm-profile` — workspace isolation and profile switching (required for code tools)
321
+ - `slm-profile` — memory profiles and the tool sets that decide which tools exist
310
322
  - `slm-recall` — retrieve architectural decisions before graph queries
311
323
  - `slm-status` — confirm the active profile and graph index health
312
324
 
313
325
  ---
314
326
 
315
- SuperLocalMemory v4.1.21 · Qualixar · AGPL-3.0-or-later
327
+ SuperLocalMemory v4.1.23 · Qualixar · AGPL-3.0-or-later
@@ -1,8 +1,8 @@
1
1
  ---
2
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, recall
3
+ description: Gate-verified bounded loops with SuperLocalMemory as the durable ledger. Use when a task has a checkable acceptance condition and you must iterate until an INDEPENDENT gate passes — never stopping because the agent believes it is done. `slm_loop_run` (MCP) waits, under hard bounds, for a recall gate to pass; `slm loop demo` shows the control flow keyless; `slm loop history` and `slm loop show <run_id>` (or `slm_loop_history` / `slm_loop_show`) inspect past runs, whose every lap is stored 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, wait for another agent's result"
5
+ allowed-tools: slm_loop_run, slm_loop_history, slm_loop_show, recall, Bash
6
6
  ---
7
7
 
8
8
  # slm-loop — Bounded, gate-verified agent loops
@@ -16,19 +16,71 @@ this skill: **the gate is the authority.**
16
16
 
17
17
  Use a bounded loop whenever the goal has a mechanical, checkable contract: a
18
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).
19
+ a security scan. When the goal is subjective, keep a human approval gate.
20
+
21
+ ## What SLM runs, and what you run
22
+
23
+ SLM's loop engine runs the laps, enforces the bounds, calls the gate and writes
24
+ the ledger. It does **not** start your tests or linters: it carries no
25
+ subprocess or sandbox machinery. What each surface gives you:
26
+
27
+ | Surface | What it does |
28
+ |---|---|
29
+ | `slm_loop_run` (MCP) | A *watcher*: each lap is a recall of `gate_query`; the loop ends when a confident match appears, or a bound trips. Use it to wait for a verification or coordination memory another agent will write (for example "build passed"). |
30
+ | `slm loop demo` (CLI) | A keyless convergence demo: a stub proposer, a deterministic gate that passes on lap 3, every lap recorded. Proves the engine and ledger work end to end. |
31
+ | `slm loop history`, `slm loop show` / `slm_loop_history`, `slm_loop_show` | Read the ledger of past runs. |
32
+ | `superlocalmemory.loops.run_bounded_loop` (Python) | The engine itself, for code that supplies its own runner and gate callables. |
33
+
34
+ For a task whose gate is a command (`pytest -q`, a schema validation), you run
35
+ that command yourself each lap with Bash and read its exit code; the discipline
36
+ below still applies, but SLM is not recording those laps. For graph runs with
37
+ receipts, use the separate Bounded Loops product; SLM can take a read-only
38
+ snapshot of its finished runs with `observe_bounded_loop_evidence(workspace)`
39
+ (an absolute path), which records observations only and never changes recall or
40
+ ranking.
21
41
 
22
42
  ## What SLM adds
23
43
 
24
- Every lap is written to SuperLocalMemory as a durable, queryable memory (tagged
25
- `loop:<name>`, session `loop:<run_id>`). That makes a run:
44
+ Every lap SLM runs is written as a durable, queryable memory (tagged `loop:<name>`,
45
+ session `loop:<run_id>`). That makes a run:
26
46
 
27
- - **auditable** — inspect the decision + gate verdict + budget for each lap;
28
- - **resumable / historical** — a run's ledger survives across sessions;
47
+ - **auditable** — inspect the decision, gate verdict and budget for each lap;
48
+ - **historical** — a run's ledger survives across sessions;
29
49
  - **discoverable** — visible via `slm recall`, the dashboard, and any
30
50
  SLM-integrated tool, alongside everything else the agent remembers.
31
51
 
52
+ ## MCP: `slm_loop_run`
53
+
54
+ ```
55
+ slm_loop_run(
56
+ name: str, # 1–128 chars; also the memory tag
57
+ gate_query: str, # the recall the gate checks each lap (up to 2000 chars)
58
+ gate_min_score: float = 0.0, # minimum top-result score to pass
59
+ max_iterations: int = 20, # hard lap cap, 1–200
60
+ max_wallclock_s: float = 15.0,# hard time cap; 0 disables; never more than 120
61
+ poll_interval_s: float = 1.0, # wait between laps; at least 0.25
62
+ max_tokens: int = 0, # optional token budget; 0 disables
63
+ no_progress_window: int = 0, # halt after N no-change laps; leave 0 for a watcher
64
+ require_support: bool = False,# pass only if the answer check ran and judged it sufficient
65
+ )
66
+ ```
67
+
68
+ The call **blocks** until the gate passes or a bound trips, then returns
69
+ `{ok, status, reason, passed, laps, run_id, ledger: [{lap, decision, passed, detail}]}`.
70
+ The gate recalls at most three memories per lap and ignores the loop's own
71
+ ledger entries, so only a memory written by someone else can satisfy it. A
72
+ recall the answer check judged insufficient never passes, even with a high
73
+ score; with `require_support=True` an unchecked recall (check off, busy,
74
+ loading, out of time) does not pass either. When the answer check is on, each
75
+ lap asks it once about those memories; with the online check that is a request
76
+ to the provider and may be billed. `slm_loop_run` is not available to remote
77
+ callers.
78
+
79
+ ```
80
+ slm_loop_history(name, limit=20) # runs recorded under a loop name
81
+ slm_loop_show(run_id, limit=200) # every lap of one run, in order
82
+ ```
83
+
32
84
  ## CLI
33
85
 
34
86
  ```bash
@@ -37,9 +89,7 @@ slm loop history [--name NAME] [--json] # list recorded runs
37
89
  slm loop show <run_id> [--json] # every lap of one run
38
90
  ```
39
91
 
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.
92
+ There is no `slm loop run`.
43
93
 
44
94
  ## The bounds
45
95
 
@@ -49,11 +99,14 @@ A loop runs inside a safety envelope. Any bound tripping ends the run with
49
99
  - **max_iterations** — a hard lap cap.
50
100
  - **no_progress_window** — consecutive no-change laps before halting a spinning
51
101
  agent.
52
- - **token budget / wall-clock** — cumulative ceilings.
53
- - **kill switch** — set `SLM_LOOP_KILL` to stop before the next lap.
102
+ - **token budget / wall-clock** — cumulative ceilings, checked again after each
103
+ lap, so an overshooting lap halts even if its gate would pass.
104
+ - **kill switch** — a non-empty `SLM_LOOP_KILL` in the loop's process
105
+ environment stops it before the next lap, with status `KILLED`.
54
106
  - **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.
107
+ (unattended). L2 and L3 require approval before a passing gate is accepted as
108
+ DONE unless approval is explicitly configured off. `slm_loop_run` and the demo
109
+ run at L1, so `PAUSE` arises only from code that sets a higher rung.
57
110
 
58
111
  ## Terminal statuses — report exactly
59
112
 
@@ -72,8 +125,8 @@ paused, name the approval needed; when errored, quote the short detail.
72
125
  ## Reporting workflow
73
126
 
74
127
  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>`).
128
+ 2. Read back the ledger with `slm_loop_show` or `slm loop show <run_id>` (or
129
+ `slm recall` on tag `loop:<name>`).
77
130
  3. Report the exact terminal status, the lap count, and the gate's final
78
131
  verdict. Include the `run_id` so the run can be re-inspected later.
79
132
 
@@ -91,9 +144,10 @@ paused, name the approval needed; when errored, quote the short detail.
91
144
  ## Related skills
92
145
 
93
146
  - `slm-status` — confirm SLM is healthy before relying on the ledger.
94
- - `slm-recall` — query a loop's laps directly (`loop:<name>` tag).
147
+ - `slm-recall` — query a loop's laps directly (`loop:<name>` tag), and the
148
+ answer-check fields the recall gate depends on.
95
149
  - `slm-session` — session lifecycle around a longer loop run.
96
150
 
97
151
  ---
98
152
 
99
- SuperLocalMemory v4.1.21 · Qualixar · AGPL-3.0-or-later
153
+ SuperLocalMemory v4.1.23 · Qualixar · AGPL-3.0-or-later