@wipcomputer/memory-crystal 0.7.30 → 0.7.32

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 (211) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/SKILL.md +1 -1
  3. package/package.json +1 -1
  4. package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/.env.example +0 -20
  5. package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/.publish-skill.json +0 -1
  6. package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/CHANGELOG.md +0 -1297
  7. package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/CLA.md +0 -19
  8. package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/LICENSE +0 -52
  9. package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/README-ENTERPRISE.md +0 -226
  10. package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/README.md +0 -151
  11. package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/RELAY.md +0 -199
  12. package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/SKILL.md +0 -462
  13. package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/TECHNICAL.md +0 -656
  14. package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/_trash/RELEASE-NOTES-v0-7-23.md +0 -48
  15. package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/_trash/RELEASE-NOTES-v0-7-25.md +0 -24
  16. package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/_trash/RELEASE-NOTES-v0-7-26.md +0 -7
  17. package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/_trash/RELEASE-NOTES-v0-7-28.md +0 -31
  18. package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/_trash/RELEASE-NOTES-v0-7-29.md +0 -28
  19. package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/_trash/RELEASE-NOTES-v0-7-4.md +0 -64
  20. package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/_trash/RELEASE-NOTES-v0-7-5.md +0 -19
  21. package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/cloud/README.md +0 -116
  22. package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/cloud/docs/gpt-system-instructions.md +0 -69
  23. package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/cloud/migrations/0001_init.sql +0 -52
  24. package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/migrations/0001_init.sql +0 -51
  25. package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/migrations/0002_cloud_storage.sql +0 -49
  26. package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/openclaw.plugin.json +0 -11
  27. package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/package-lock.json +0 -4169
  28. package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/package.json +0 -61
  29. package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/scripts/crystal-capture.sh +0 -29
  30. package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/scripts/deploy-cloud.sh +0 -153
  31. package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/scripts/ldm-backup.sh +0 -116
  32. package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/scripts/migrate-lance-to-sqlite.mjs +0 -218
  33. package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/skills/memory/SKILL.md +0 -438
  34. package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/wrangler-demo.toml +0 -8
  35. package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/wrangler-mcp.toml +0 -24
  36. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/.env.example +0 -20
  37. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/.publish-skill.json +0 -1
  38. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/CHANGELOG.md +0 -1297
  39. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/CLA.md +0 -19
  40. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/LICENSE +0 -52
  41. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/README-ENTERPRISE.md +0 -226
  42. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/README.md +0 -151
  43. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/RELAY.md +0 -199
  44. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/RELEASE-NOTES-v0.7.30.md +0 -29
  45. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/SKILL.md +0 -462
  46. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/TECHNICAL.md +0 -656
  47. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/_trash/RELEASE-NOTES-v0-7-23.md +0 -48
  48. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/_trash/RELEASE-NOTES-v0-7-25.md +0 -24
  49. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/_trash/RELEASE-NOTES-v0-7-26.md +0 -7
  50. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/_trash/RELEASE-NOTES-v0-7-28.md +0 -31
  51. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/_trash/RELEASE-NOTES-v0-7-29.md +0 -28
  52. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/_trash/RELEASE-NOTES-v0-7-4.md +0 -64
  53. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/_trash/RELEASE-NOTES-v0-7-5.md +0 -19
  54. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/cloud/README.md +0 -116
  55. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/cloud/docs/gpt-system-instructions.md +0 -69
  56. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/cloud/migrations/0001_init.sql +0 -52
  57. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/migrations/0001_init.sql +0 -51
  58. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/migrations/0002_cloud_storage.sql +0 -49
  59. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/openclaw.plugin.json +0 -11
  60. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/package-lock.json +0 -4169
  61. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/package.json +0 -61
  62. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/scripts/crystal-capture.sh +0 -29
  63. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/scripts/deploy-cloud.sh +0 -153
  64. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/scripts/ldm-backup.sh +0 -116
  65. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/scripts/migrate-lance-to-sqlite.mjs +0 -218
  66. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/skills/memory/SKILL.md +0 -438
  67. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/wrangler-demo.toml +0 -8
  68. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/wrangler-mcp.toml +0 -24
  69. package/_trash/RELEASE-NOTES-v0-7-23.md +0 -48
  70. package/_trash/RELEASE-NOTES-v0-7-25.md +0 -24
  71. package/_trash/RELEASE-NOTES-v0-7-26.md +0 -7
  72. package/_trash/RELEASE-NOTES-v0-7-28.md +0 -31
  73. package/_trash/RELEASE-NOTES-v0-7-29.md +0 -28
  74. package/_trash/RELEASE-NOTES-v0-7-4.md +0 -64
  75. package/_trash/RELEASE-NOTES-v0-7-5.md +0 -19
  76. package/_trash/RELEASE-NOTES-v0.7.30.md +0 -29
  77. package/dist/bridge.d.ts +0 -7
  78. package/dist/bridge.js +0 -14
  79. package/dist/bulk-copy.d.ts +0 -17
  80. package/dist/bulk-copy.js +0 -90
  81. package/dist/cc-hook.d.ts +0 -8
  82. package/dist/cc-hook.js +0 -368
  83. package/dist/cc-poller.d.ts +0 -1
  84. package/dist/cc-poller.js +0 -550
  85. package/dist/chunk-25LXQJ4Z.js +0 -110
  86. package/dist/chunk-2DRXIRQW.js +0 -97
  87. package/dist/chunk-2ZNH5F6E.js +0 -1281
  88. package/dist/chunk-3G3SFYYI.js +0 -288
  89. package/dist/chunk-3RG5ZIWI.js +0 -10
  90. package/dist/chunk-3S6TI23B.js +0 -97
  91. package/dist/chunk-3VFIJYS4.js +0 -818
  92. package/dist/chunk-52QE3YI3.js +0 -1169
  93. package/dist/chunk-57RP3DIN.js +0 -1205
  94. package/dist/chunk-5HSZ4W2P.js +0 -62
  95. package/dist/chunk-645IPXW3.js +0 -290
  96. package/dist/chunk-7A7ELD4C.js +0 -1205
  97. package/dist/chunk-7FYY4GZM.js +0 -1205
  98. package/dist/chunk-7IUE7ODU.js +0 -254
  99. package/dist/chunk-7RMLKZIS.js +0 -108
  100. package/dist/chunk-AA3OPP4Z.js +0 -432
  101. package/dist/chunk-AEWLSYPH.js +0 -72
  102. package/dist/chunk-ASSZDR6I.js +0 -108
  103. package/dist/chunk-AYRJVWUC.js +0 -1205
  104. package/dist/chunk-CCYI5O3D.js +0 -148
  105. package/dist/chunk-D3I3ZSE2.js +0 -411
  106. package/dist/chunk-DACSKLY6.js +0 -219
  107. package/dist/chunk-DW5B4BL7.js +0 -108
  108. package/dist/chunk-EKSACBTJ.js +0 -1070
  109. package/dist/chunk-EXEZZADG.js +0 -248
  110. package/dist/chunk-F3Y7EL7K.js +0 -83
  111. package/dist/chunk-FBQWSDPC.js +0 -1328
  112. package/dist/chunk-FHRZNOMW.js +0 -1205
  113. package/dist/chunk-IM7N24MT.js +0 -129
  114. package/dist/chunk-IPNYIXFK.js +0 -1178
  115. package/dist/chunk-J7MRSZIO.js +0 -167
  116. package/dist/chunk-JITKI2OI.js +0 -106
  117. package/dist/chunk-JWZXYVET.js +0 -1068
  118. package/dist/chunk-KCQUXVYT.js +0 -108
  119. package/dist/chunk-KOQ43OX6.js +0 -1281
  120. package/dist/chunk-KYVWO6ZM.js +0 -1069
  121. package/dist/chunk-L3VHARQH.js +0 -413
  122. package/dist/chunk-LBWDS6BE.js +0 -288
  123. package/dist/chunk-LOVAHSQV.js +0 -411
  124. package/dist/chunk-LQOYCAGG.js +0 -446
  125. package/dist/chunk-LWAIPJ2W.js +0 -146
  126. package/dist/chunk-M5DHKW7M.js +0 -127
  127. package/dist/chunk-MBKCIJHM.js +0 -1328
  128. package/dist/chunk-MK42FMEG.js +0 -147
  129. package/dist/chunk-MOBMYHKL.js +0 -1205
  130. package/dist/chunk-MPLTNMRG.js +0 -67
  131. package/dist/chunk-NIJCVN3O.js +0 -147
  132. package/dist/chunk-NZCFSZQ7.js +0 -1205
  133. package/dist/chunk-O2UITJGH.js +0 -465
  134. package/dist/chunk-OCRA44AZ.js +0 -108
  135. package/dist/chunk-P3KJR66H.js +0 -117
  136. package/dist/chunk-PEK6JH65.js +0 -432
  137. package/dist/chunk-PJ6FFKEX.js +0 -77
  138. package/dist/chunk-PLUBBZYR.js +0 -800
  139. package/dist/chunk-PNKVD2UK.js +0 -26
  140. package/dist/chunk-PSQZURHO.js +0 -229
  141. package/dist/chunk-SGL6ISBJ.js +0 -1061
  142. package/dist/chunk-SJABZZT5.js +0 -97
  143. package/dist/chunk-TD3P3K32.js +0 -1199
  144. package/dist/chunk-TMDZJJKV.js +0 -288
  145. package/dist/chunk-UNHVZB5G.js +0 -411
  146. package/dist/chunk-VAFTWSTE.js +0 -1061
  147. package/dist/chunk-VNFXFQBB.js +0 -217
  148. package/dist/chunk-X3GVFKSJ.js +0 -1205
  149. package/dist/chunk-XZ3S56RQ.js +0 -1061
  150. package/dist/chunk-Y72C7F6O.js +0 -148
  151. package/dist/chunk-YLICP577.js +0 -1205
  152. package/dist/chunk-YX6AXLVK.js +0 -159
  153. package/dist/chunk-ZCQYHTNU.js +0 -146
  154. package/dist/cli.d.ts +0 -1
  155. package/dist/cli.js +0 -1105
  156. package/dist/cloud-crystal.js +0 -6
  157. package/dist/core.d.ts +0 -232
  158. package/dist/core.js +0 -12
  159. package/dist/crypto.d.ts +0 -20
  160. package/dist/crypto.js +0 -27
  161. package/dist/crystal-capture.sh +0 -29
  162. package/dist/crystal-serve.d.ts +0 -4
  163. package/dist/crystal-serve.js +0 -252
  164. package/dist/dev-update-SZ2Z4WCQ.js +0 -6
  165. package/dist/discover.d.ts +0 -30
  166. package/dist/discover.js +0 -177
  167. package/dist/doctor.d.ts +0 -9
  168. package/dist/doctor.js +0 -334
  169. package/dist/dream-weaver.d.ts +0 -8
  170. package/dist/dream-weaver.js +0 -56
  171. package/dist/file-sync.d.ts +0 -48
  172. package/dist/file-sync.js +0 -18
  173. package/dist/installer.d.ts +0 -61
  174. package/dist/installer.js +0 -676
  175. package/dist/ldm-backup.sh +0 -116
  176. package/dist/ldm.d.ts +0 -50
  177. package/dist/ldm.js +0 -32
  178. package/dist/mcp-server.d.ts +0 -1
  179. package/dist/mcp-server.js +0 -265
  180. package/dist/migrate.d.ts +0 -1
  181. package/dist/migrate.js +0 -89
  182. package/dist/mirror-sync.d.ts +0 -1
  183. package/dist/mirror-sync.js +0 -159
  184. package/dist/oc-backfill.d.ts +0 -19
  185. package/dist/oc-backfill.js +0 -74
  186. package/dist/openclaw.d.ts +0 -5
  187. package/dist/openclaw.js +0 -423
  188. package/dist/pair.d.ts +0 -4
  189. package/dist/pair.js +0 -75
  190. package/dist/poller.d.ts +0 -1
  191. package/dist/poller.js +0 -634
  192. package/dist/role.d.ts +0 -24
  193. package/dist/role.js +0 -13
  194. package/dist/search-pipeline-4K4OJSSS.js +0 -255
  195. package/dist/search-pipeline-4PRS6LI7.js +0 -280
  196. package/dist/search-pipeline-7UJMXPLO.js +0 -280
  197. package/dist/search-pipeline-DQTRLGBH.js +0 -74
  198. package/dist/search-pipeline-HNG37REH.js +0 -282
  199. package/dist/search-pipeline-IZFPLBUB.js +0 -280
  200. package/dist/search-pipeline-MID6F26Q.js +0 -73
  201. package/dist/search-pipeline-N52JZFNN.js +0 -282
  202. package/dist/search-pipeline-OPB2PRQQ.js +0 -280
  203. package/dist/search-pipeline-VXTE5HAD.js +0 -262
  204. package/dist/search-pipeline-XHFKADRG.js +0 -73
  205. package/dist/staging.d.ts +0 -29
  206. package/dist/staging.js +0 -21
  207. package/dist/summarize.d.ts +0 -19
  208. package/dist/summarize.js +0 -10
  209. package/dist/worker-demo.js +0 -186
  210. package/dist/worker-mcp.js +0 -404
  211. package/dist/worker.js +0 -137
@@ -1,1297 +0,0 @@
1
- # Changelog
2
-
3
-
4
-
5
-
6
-
7
-
8
-
9
-
10
-
11
-
12
-
13
-
14
-
15
-
16
-
17
-
18
-
19
-
20
-
21
-
22
- ## 0.7.29 (2026-03-20)
23
-
24
- # Release Notes: memory-crystal v0.7.29
25
-
26
- **Doc audit: MLX setup, deep search params, log paths, role clarification.**
27
-
28
- ## What changed
29
-
30
- SKILL.md and TECHNICAL.md updated for 2 weeks of undocumented features:
31
-
32
- - **MLX local LLM:** Added as Option A in SKILL.md Step 2. CLI commands (setup, status, stop) added to TECHNICAL.md.
33
- - **Deep search parameters:** `--intent`, `--explain`, `--candidates` documented in both SKILL.md (crystal_search tool) and TECHNICAL.md (CLI reference + new sections for intent, explain, candidate limit, LLM cache).
34
- - **Log paths:** Fixed obsolete `/tmp/ldm-dev-tools/` reference to `~/.ldm/logs/`. Added logs/ to directory structure.
35
- - **Role clarification:** Two-role architecture (Core and Node) explicitly stated. Standalone role was removed in v0.7.22.
36
-
37
- ## Why
38
-
39
- 29 releases in 13 days. Docs didn't keep pace. Agents using crystal_search didn't know about --intent (query disambiguation) or --explain (scoring transparency).
40
-
41
- ## Issues closed
42
-
43
- - #57
44
-
45
- ## How to verify
46
-
47
- ```bash
48
- grep "intent" SKILL.md TECHNICAL.md
49
- grep "mlx" SKILL.md TECHNICAL.md
50
- grep "ldm/logs" TECHNICAL.md
51
- ```
52
-
53
- ## 0.7.28 (2026-03-18)
54
-
55
- # Release Notes: memory-crystal v0.7.28
56
-
57
- **One-line summary of what this release does**
58
-
59
- ## What changed
60
-
61
- Describe the changes. Not a commit list. Explain:
62
- - What was built or fixed
63
- - Why it matters
64
- - What the user should know
65
-
66
- ## Why
67
-
68
- What problem does this solve? What was broken or missing?
69
-
70
- ## Issues closed
71
-
72
- - #91
73
-
74
- ## How to verify
75
-
76
- ```bash
77
- # Commands to test the changes
78
- ```
79
-
80
- ## 0.7.27 (2026-03-17)
81
-
82
- # Add root SKILL.md + ldm install as primary path
83
-
84
- Added SKILL.md to repo root (source of truth for wip-release website publishing). `ldm install wipcomputer/memory-crystal` is now the recommended install path. `crystal init` stays for MC-specific setup (database, cron, role, pairing).
85
-
86
- Also added `.publish-skill.json` so wip-release publishes SKILL.md to wip.computer/install/.
87
-
88
- Closes wipcomputer/wip-ldm-os#97. Convergence tracked in wipcomputer/wip-ldm-os#99.
89
-
90
- ## 0.7.26 (2026-03-16)
91
-
92
- # Memory Crystal v0.7.26
93
-
94
- Add repository field to package.json. GitHub Packages needs this to link packages to the repo.
95
-
96
- ## Issues closed
97
-
98
- - Closes #50
99
-
100
- ## 0.7.25 (2026-03-16)
101
-
102
- # Release Notes: memory-crystal v0.7.25
103
-
104
- Bump SKILL.md version and name to match package branding.
105
-
106
- ## What changed
107
-
108
- - SKILL.md version bumped from 0.4.0 to 0.7.24 (was stuck at the original version)
109
- - SKILL.md name changed from `memory` to `wip-memory-crystal` (matches branded convention)
110
- - Forces deploy to public repo, triggering auto-publish to wip.computer/install/
111
-
112
- ## Why
113
-
114
- The SKILL.md version was out of sync with the package version. The name didn't match the `wip-` branding convention used across all install files on wip.computer.
115
-
116
- ## Issues closed
117
-
118
- - #80
119
-
120
- ## How to verify
121
-
122
- ```bash
123
- crystal --version
124
- head -4 ~/.ldm/extensions/memory-crystal/skills/memory/SKILL.md
125
- ```
126
-
127
- ## 0.7.24 (2026-03-15)
128
-
129
- # Dev Update: Search Quality v2 + MLX Local LLM
130
-
131
- **Date:** 2026-03-15
132
- **Author:** CC-Mini
133
- **Session:** memory-crstal01 (continued from Mar 13-14)
134
-
135
- ---
136
-
137
- ## Summary
138
-
139
- Six search quality features from QMD v2.0 analysis, plus MLX local LLM infrastructure for Apple Silicon. All coded, tested, merged. Not yet deployed.
140
-
141
- ## What Shipped
142
-
143
- ### Search Quality (PR #75)
144
-
145
- 1. **Intent parameter.** Disambiguates queries without adding search terms. `crystal search "security" --intent "1Password"` steers toward 1Password results. Flows through expansion prompt (guides LLM variations), disables strong-signal bypass, prepended to rerank query. Available via CLI `--intent`, MCP `intent`.
146
-
147
- 2. **candidateLimit.** Tunable rerank pool size. `crystal search "query" --candidates 60`. Default stays 40. More candidates = better recall, slower reranking. Available via CLI `--candidates`, MCP `candidate_limit`.
148
-
149
- 3. **Explain mode.** Per-result scoring breakdown showing FTS score, vector score, RRF rank, reranker score, recency weight, and final blended score. `crystal search "query" --explain`. Available via CLI `--explain`, MCP `explain`.
150
-
151
- 4. **Persistent LLM cache.** `llm_cache` table in crystal.db. Expansion and reranking results cached with 7-day TTL. Content-addressable reranking (keyed by query + sorted passage hashes). Same query = instant on repeat searches. Configurable TTL via `CRYSTAL_CACHE_TTL_DAYS`.
152
-
153
- 5. **Structured search API.** `crystal.structuredSearch(queries)` accepts pre-expanded StructuredQuery[] (lex, vec, hyde). Skips LLM expansion entirely. Agents construct their own queries when they know what they want. RRF fusion with first list weighted 2x.
154
-
155
- ### MLX Local LLM (PR #76)
156
-
157
- 6. **MLX auto-install.** New `src/mlx-setup.ts` with full setup flow:
158
- - `detectPlatform()` ... Apple Silicon / Intel Mac / Linux / other
159
- - `installMlxLm()` ... uv > pip3 > pip3 --user fallback chain
160
- - `createLaunchAgent()` ... always-on MLX server via LaunchAgent
161
- - `verifyServer()` ... 30s warmup wait for model loading
162
- - `setupMlx()` ... full flow: detect, install, configure, start, verify
163
-
164
- 7. **Crystal MLX CLI.** `crystal mlx setup/status/stop` subcommands.
165
-
166
- 8. **Doctor check #13.** MLX health check with three states: not installed, installed but not running, running. Suggests fix for each.
167
-
168
- 9. **Installer integration.** `crystal init` detects Apple Silicon and suggests `crystal mlx setup` when MLX is not installed.
169
-
170
- 10. **Port 18791.** LDM service ports: 18789 (OpenClaw), 18790 (Crystal Core), 18791 (MLX LLM).
171
-
172
- 11. **Model: Qwen 2.5 3B Instruct 4-bit.** `mlx-community/Qwen2.5-3B-Instruct-4bit`. ~1.5 GB, fast on M-series, good at instruction following for query expansion and relevance scoring.
173
-
174
- ### Also
175
-
176
- - QMD v2.0 analysis written (`ai/product/notes/2026-03-15--cc-mini--qmd-v2.0-analysis.md`)
177
- - Search quality plan written (`ai/product/plans-prds/current/2026-03-15--cc-mini--search-quality-qmd-v2-port.md`)
178
- - MLX plan moved from upcoming to current
179
- - Stashed roadmap + readme-first updates recovered and committed (PR #74)
180
- - README footer: QMD credit restored, CLA + dual license confirmed on both repos
181
-
182
- ## Files Changed
183
-
184
- | File | Change |
185
- |------|--------|
186
- | `src/search-pipeline.ts` | Intent support, candidateLimit param, explain traces, DeepSearchResult type |
187
- | `src/llm.ts` | Intent in expansion prompt, persistent DB cache (expansion + reranking), setLLMCacheDb() |
188
- | `src/core.ts` | llm_cache table schema, deepSearch options, structuredSearch() method, StructuredQuery type |
189
- | `src/mcp-server.ts` | intent, candidate_limit, explain params on crystal_search, LLM cache DB wiring |
190
- | `src/cli.ts` | --intent, --candidates, --explain flags, crystal mlx subcommand |
191
- | `src/mlx-setup.ts` | **NEW** ... full MLX setup, doctor check, state management |
192
- | `src/doctor.ts` | MLX health check (#13) |
193
- | `src/installer.ts` | MLX detection in crystal init flow |
194
-
195
- ## What This Enables
196
-
197
- - **Free deep search.** MLX replaces OpenAI API calls for expansion + reranking. Zero cost per search.
198
- - **Faster repeated searches.** Persistent cache means the LLM call happens once per unique query.
199
- - **Smarter agent queries.** Structured search lets agents skip expansion when they know what they want.
200
- - **Debuggable search.** Explain mode shows exactly why each result ranked where it did.
201
- - **Offline search quality.** MLX works without internet. API fallback when MLX is down.
202
-
203
- ## 0.7.23 (2026-03-15)
204
-
205
- # Release Notes: Memory Crystal v0.7.23
206
-
207
- **Date:** 2026-03-15
208
-
209
- ## Search Quality v2 + MLX Local LLM
210
-
211
- This release adds six search quality features ported from the QMD v2.0 analysis, plus the complete MLX local LLM infrastructure for Apple Silicon. Deep search is now disambiguatable, cacheable, debuggable, and can run entirely offline on Apple Silicon.
212
-
213
- ### Intent parameter
214
-
215
- Disambiguates queries without adding search terms. `crystal search "security" --intent "1Password"` steers results toward 1Password-related security instead of repo permissions or agent secrets. Intent flows through the expansion prompt (guides LLM variations), disables strong-signal bypass (keyword match might not be what the caller wants), and is prepended to the rerank query. Available via CLI `--intent` and MCP `intent`.
216
-
217
- ### Persistent LLM cache
218
-
219
- Expansion and reranking results are now cached in crystal.db (`llm_cache` table) with a 7-day TTL. Same query = instant on repeat searches. Reranking cache is content-addressable (keyed by query + sorted passage hashes), so identical content from different sessions shares cached scores. Configurable via `CRYSTAL_CACHE_TTL_DAYS` env var.
220
-
221
- ### Explain mode
222
-
223
- Per-result scoring breakdown showing FTS score, vector score, RRF rank, reranker score, recency weight, and final blended score. `crystal search "query" --explain`. Available via CLI `--explain` and MCP `explain`. Makes search quality transparent and debuggable.
224
-
225
- ### candidateLimit
226
-
227
- Tunable rerank pool size. `crystal search "query" --candidates 60`. Default stays 40. More candidates = better recall, slower reranking. Available via CLI `--candidates` and MCP `candidate_limit`.
228
-
229
- ### Structured search API
230
-
231
- `crystal.structuredSearch(queries)` accepts pre-expanded StructuredQuery[] with typed sub-queries (lex, vec, hyde). Skips LLM expansion entirely. Agents construct their own queries when they already know what they want. RRF fusion with first list weighted 2x.
232
-
233
- ### MLX local LLM (Phase 3)
234
-
235
- Complete auto-install infrastructure for running a local LLM on Apple Silicon:
236
-
237
- - `crystal mlx setup` detects Apple Silicon, installs mlx-lm (uv > pip3 > pip3 --user), creates LaunchAgent for always-on server
238
- - Model: `mlx-community/Qwen2.5-3B-Instruct-4bit` (~1.5 GB, fast on M-series)
239
- - Port 18791 (18789 OpenClaw, 18790 Crystal Core, 18791 MLX)
240
- - `crystal mlx status` and `crystal mlx stop` for server management
241
- - `crystal doctor` check #13: MLX health (not installed / down / running)
242
- - `crystal init` detects Apple Silicon and suggests MLX setup
243
- - State file at `~/.ldm/state/mlx-server.json`
244
-
245
- ### Also in this release
246
-
247
- - QMD v2.0 analysis documented (`ai/product/notes/`)
248
- - Search quality plan written (`ai/product/plans-prds/current/`)
249
- - MLX plan moved from upcoming to current
250
- - Stashed roadmap + readme-first updates recovered (PR #74)
251
-
252
- Closes #57, #63, #64.
253
-
254
- ## 0.7.22 (2026-03-14)
255
-
256
- Remove standalone role
257
-
258
- ## 0.7.21 (2026-03-14)
259
-
260
- Fix install URL
261
-
262
- ## 0.7.20 (2026-03-14)
263
-
264
- Add CLA, dual LICENSE, standardize README footer
265
-
266
- ## 0.7.19 (2026-03-14)
267
-
268
- Fix score normalization
269
-
270
- ## 0.7.18 (2026-03-13)
271
-
272
- # Dev Update: Orphan Cleanup, DELETE Trigger, Doctor Fix
273
-
274
- **Date:** 2026-03-13
275
- **Author:** CC-Mini
276
- **Session:** memory-db-fix
277
-
278
- ---
279
-
280
- ## What Happened
281
-
282
- Parker ran the Memory Crystal install prompt and `crystal doctor` reported "Embeddings: FAILING ... no provider configured in env." Investigation revealed two separate issues:
283
-
284
- ### Issue 1: Doctor False Positive
285
-
286
- `checkEmbeddingProvider()` in `doctor.ts` only checked `process.env.OPENAI_API_KEY`. But the cron job and hooks resolve the key from 1Password via the SA token at `~/.openclaw/secrets/op-sa-token`. The doctor didn't know about this path.
287
-
288
- **Fix:** Added `checkOpEmbeddings()` helper to `doctor.ts` that checks for the SA token file, then does a live `op read` to verify it works. Doctor now reports `ok: openai (via 1Password)` instead of `fail`.
289
-
290
- ### Issue 2: Orphaned Vectors and FTS Entries
291
-
292
- On 2026-03-11, 141,652 bulk file-scan chunks were correctly deleted from the `chunks` table. Parker said: "Why are we indexing documents?" These were raw file scans (Python venv packages, TypeScript source, vendor code) with no conversational context.
293
-
294
- The deletion used raw SQL (`DELETE FROM chunks WHERE agent_id = 'system'`). But Memory Crystal had no DELETE trigger. The corresponding entries in `chunks_vec` (sqlite-vec) and `chunks_fts` (FTS5) were left orphaned.
295
-
296
- **Impact:**
297
- - 141,651 orphaned vectors (~875 MB)
298
- - 141,652 orphaned FTS entries
299
- - ~7% of search queries hit phantom results (silently filtered out)
300
- - Database: 1.96 GB (should have been ~1 GB)
301
-
302
- **Fix (three parts):**
303
-
304
- 1. **DELETE trigger** added to `initChunksTables()` in `core.ts`:
305
- ```sql
306
- CREATE TRIGGER IF NOT EXISTS chunks_cleanup AFTER DELETE ON chunks
307
- BEGIN
308
- DELETE FROM chunks_vec WHERE chunk_id = OLD.id;
309
- INSERT INTO chunks_fts(chunks_fts, rowid, text) VALUES('delete', OLD.id, OLD.text);
310
- END;
311
- ```
312
-
313
- 2. **`cleanOrphans()` method** added to Crystal class in `core.ts`. Counts orphaned vec/FTS entries, deletes vec orphans in batches of 1000, rebuilds FTS5 from scratch.
314
-
315
- 3. **`crystal cleanup` CLI command** added to `cli.ts`. Handles the full workflow: backup, pause cron, clean orphans, VACUUM, resume cron. Supports `--dry-run`.
316
-
317
- **Cleanup results:**
318
- - 141,651 orphaned vectors removed
319
- - FTS rebuilt from 73,813 chunks in 5.7s
320
- - Database: 1.96 GB -> 1.45 GB (525 MB saved)
321
- - Verification: chunks = FTS entries = 73,813. Match: YES
322
- - Zero orphans remaining
323
-
324
- ### Side Discovery: Plaintext SA Token
325
-
326
- During investigation, discovered that `~/.openclaw/secrets/op-sa-token` is a plaintext 1Password SA token readable by any process running as `lesa`. This is the bootstrap credential that unlocks all secrets. Bug report filed. Long-term fix: Lesa iOS app with remote biometrics (product doc written).
327
-
328
- ### Product Rule Established
329
-
330
- Memory Crystal indexes conversations only. File content that appears in conversation turns (agent reads a file, discusses it) is captured as part of the conversation. Raw directory scanning without conversational context is not what Memory Crystal is for.
331
-
332
- ## Files Changed
333
-
334
- | File | Change |
335
- |------|--------|
336
- | `src/core.ts` | Added `chunks_cleanup` DELETE trigger, `cleanOrphans()` method |
337
- | `src/cli.ts` | Added `crystal cleanup` command, updated imports and USAGE |
338
- | `src/doctor.ts` | Added `checkOpEmbeddings()` for 1Password detection |
339
- | `ai/product/bugs/2026-03-13--orphaned-vectors-and-fts-after-bulk-delete.md` | Bug report |
340
-
341
- ## Related (wip-secrets-ios-private)
342
-
343
- | File | What |
344
- |------|------|
345
- | `ai/product/product-ideas/lesa-app-remote-biometrics.md` | Lesa app: remote biometrics for agent computers |
346
- | `ai/product/bugs/2026-03-13--plaintext-sa-token-on-disk.md` | Plaintext SA token bug report |
347
-
348
- ## Status
349
-
350
- - Code deployed and running (cleanup already executed)
351
- - Not yet committed / PR'd / released
352
- - Needs: branch, commit, PR, merge, `wip-release patch`
353
-
354
- ## 0.7.17 (2026-03-13)
355
-
356
- # Dev Update: Orphan Cleanup, DELETE Trigger, Doctor Fix
357
-
358
- **Date:** 2026-03-13
359
- **Author:** CC-Mini
360
- **Session:** memory-db-fix
361
-
362
- ---
363
-
364
- ## What Happened
365
-
366
- Parker ran the Memory Crystal install prompt and `crystal doctor` reported "Embeddings: FAILING ... no provider configured in env." Investigation revealed two separate issues:
367
-
368
- ### Issue 1: Doctor False Positive
369
-
370
- `checkEmbeddingProvider()` in `doctor.ts` only checked `process.env.OPENAI_API_KEY`. But the cron job and hooks resolve the key from 1Password via the SA token at `~/.openclaw/secrets/op-sa-token`. The doctor didn't know about this path.
371
-
372
- **Fix:** Added `checkOpEmbeddings()` helper to `doctor.ts` that checks for the SA token file, then does a live `op read` to verify it works. Doctor now reports `ok: openai (via 1Password)` instead of `fail`.
373
-
374
- ### Issue 2: Orphaned Vectors and FTS Entries
375
-
376
- On 2026-03-11, 141,652 bulk file-scan chunks were correctly deleted from the `chunks` table. Parker said: "Why are we indexing documents?" These were raw file scans (Python venv packages, TypeScript source, vendor code) with no conversational context.
377
-
378
- The deletion used raw SQL (`DELETE FROM chunks WHERE agent_id = 'system'`). But Memory Crystal had no DELETE trigger. The corresponding entries in `chunks_vec` (sqlite-vec) and `chunks_fts` (FTS5) were left orphaned.
379
-
380
- **Impact:**
381
- - 141,651 orphaned vectors (~875 MB)
382
- - 141,652 orphaned FTS entries
383
- - ~7% of search queries hit phantom results (silently filtered out)
384
- - Database: 1.96 GB (should have been ~1 GB)
385
-
386
- **Fix (three parts):**
387
-
388
- 1. **DELETE trigger** added to `initChunksTables()` in `core.ts`:
389
- ```sql
390
- CREATE TRIGGER IF NOT EXISTS chunks_cleanup AFTER DELETE ON chunks
391
- BEGIN
392
- DELETE FROM chunks_vec WHERE chunk_id = OLD.id;
393
- INSERT INTO chunks_fts(chunks_fts, rowid, text) VALUES('delete', OLD.id, OLD.text);
394
- END;
395
- ```
396
-
397
- 2. **`cleanOrphans()` method** added to Crystal class in `core.ts`. Counts orphaned vec/FTS entries, deletes vec orphans in batches of 1000, rebuilds FTS5 from scratch.
398
-
399
- 3. **`crystal cleanup` CLI command** added to `cli.ts`. Handles the full workflow: backup, pause cron, clean orphans, VACUUM, resume cron. Supports `--dry-run`.
400
-
401
- **Cleanup results:**
402
- - 141,651 orphaned vectors removed
403
- - FTS rebuilt from 73,813 chunks in 5.7s
404
- - Database: 1.96 GB -> 1.45 GB (525 MB saved)
405
- - Verification: chunks = FTS entries = 73,813. Match: YES
406
- - Zero orphans remaining
407
-
408
- ### Side Discovery: Plaintext SA Token
409
-
410
- During investigation, discovered that `~/.openclaw/secrets/op-sa-token` is a plaintext 1Password SA token readable by any process running as `lesa`. This is the bootstrap credential that unlocks all secrets. Bug report filed. Long-term fix: Lesa iOS app with remote biometrics (product doc written).
411
-
412
- ### Product Rule Established
413
-
414
- Memory Crystal indexes conversations only. File content that appears in conversation turns (agent reads a file, discusses it) is captured as part of the conversation. Raw directory scanning without conversational context is not what Memory Crystal is for.
415
-
416
- ## Files Changed
417
-
418
- | File | Change |
419
- |------|--------|
420
- | `src/core.ts` | Added `chunks_cleanup` DELETE trigger, `cleanOrphans()` method |
421
- | `src/cli.ts` | Added `crystal cleanup` command, updated imports and USAGE |
422
- | `src/doctor.ts` | Added `checkOpEmbeddings()` for 1Password detection |
423
- | `ai/product/bugs/2026-03-13--orphaned-vectors-and-fts-after-bulk-delete.md` | Bug report |
424
-
425
- ## Related (wip-secrets-ios-private)
426
-
427
- | File | What |
428
- |------|------|
429
- | `ai/product/product-ideas/lesa-app-remote-biometrics.md` | Lesa app: remote biometrics for agent computers |
430
- | `ai/product/bugs/2026-03-13--plaintext-sa-token-on-disk.md` | Plaintext SA token bug report |
431
-
432
- ## Status
433
-
434
- - Code deployed and running (cleanup already executed)
435
- - Not yet committed / PR'd / released
436
- - Needs: branch, commit, PR, merge, `wip-release patch`
437
-
438
- ## 0.7.16 (2026-03-13)
439
-
440
- # Dev Update: Orphan Cleanup, DELETE Trigger, Doctor Fix
441
-
442
- **Date:** 2026-03-13
443
- **Author:** CC-Mini
444
- **Session:** memory-db-fix
445
-
446
- ---
447
-
448
- ## What Happened
449
-
450
- Parker ran the Memory Crystal install prompt and `crystal doctor` reported "Embeddings: FAILING ... no provider configured in env." Investigation revealed two separate issues:
451
-
452
- ### Issue 1: Doctor False Positive
453
-
454
- `checkEmbeddingProvider()` in `doctor.ts` only checked `process.env.OPENAI_API_KEY`. But the cron job and hooks resolve the key from 1Password via the SA token at `~/.openclaw/secrets/op-sa-token`. The doctor didn't know about this path.
455
-
456
- **Fix:** Added `checkOpEmbeddings()` helper to `doctor.ts` that checks for the SA token file, then does a live `op read` to verify it works. Doctor now reports `ok: openai (via 1Password)` instead of `fail`.
457
-
458
- ### Issue 2: Orphaned Vectors and FTS Entries
459
-
460
- On 2026-03-11, 141,652 bulk file-scan chunks were correctly deleted from the `chunks` table. Parker said: "Why are we indexing documents?" These were raw file scans (Python venv packages, TypeScript source, vendor code) with no conversational context.
461
-
462
- The deletion used raw SQL (`DELETE FROM chunks WHERE agent_id = 'system'`). But Memory Crystal had no DELETE trigger. The corresponding entries in `chunks_vec` (sqlite-vec) and `chunks_fts` (FTS5) were left orphaned.
463
-
464
- **Impact:**
465
- - 141,651 orphaned vectors (~875 MB)
466
- - 141,652 orphaned FTS entries
467
- - ~7% of search queries hit phantom results (silently filtered out)
468
- - Database: 1.96 GB (should have been ~1 GB)
469
-
470
- **Fix (three parts):**
471
-
472
- 1. **DELETE trigger** added to `initChunksTables()` in `core.ts`:
473
- ```sql
474
- CREATE TRIGGER IF NOT EXISTS chunks_cleanup AFTER DELETE ON chunks
475
- BEGIN
476
- DELETE FROM chunks_vec WHERE chunk_id = OLD.id;
477
- INSERT INTO chunks_fts(chunks_fts, rowid, text) VALUES('delete', OLD.id, OLD.text);
478
- END;
479
- ```
480
-
481
- 2. **`cleanOrphans()` method** added to Crystal class in `core.ts`. Counts orphaned vec/FTS entries, deletes vec orphans in batches of 1000, rebuilds FTS5 from scratch.
482
-
483
- 3. **`crystal cleanup` CLI command** added to `cli.ts`. Handles the full workflow: backup, pause cron, clean orphans, VACUUM, resume cron. Supports `--dry-run`.
484
-
485
- **Cleanup results:**
486
- - 141,651 orphaned vectors removed
487
- - FTS rebuilt from 73,813 chunks in 5.7s
488
- - Database: 1.96 GB -> 1.45 GB (525 MB saved)
489
- - Verification: chunks = FTS entries = 73,813. Match: YES
490
- - Zero orphans remaining
491
-
492
- ### Side Discovery: Plaintext SA Token
493
-
494
- During investigation, discovered that `~/.openclaw/secrets/op-sa-token` is a plaintext 1Password SA token readable by any process running as `lesa`. This is the bootstrap credential that unlocks all secrets. Bug report filed. Long-term fix: Lesa iOS app with remote biometrics (product doc written).
495
-
496
- ### Product Rule Established
497
-
498
- Memory Crystal indexes conversations only. File content that appears in conversation turns (agent reads a file, discusses it) is captured as part of the conversation. Raw directory scanning without conversational context is not what Memory Crystal is for.
499
-
500
- ## Files Changed
501
-
502
- | File | Change |
503
- |------|--------|
504
- | `src/core.ts` | Added `chunks_cleanup` DELETE trigger, `cleanOrphans()` method |
505
- | `src/cli.ts` | Added `crystal cleanup` command, updated imports and USAGE |
506
- | `src/doctor.ts` | Added `checkOpEmbeddings()` for 1Password detection |
507
- | `ai/product/bugs/2026-03-13--orphaned-vectors-and-fts-after-bulk-delete.md` | Bug report |
508
-
509
- ## Related (wip-secrets-ios-private)
510
-
511
- | File | What |
512
- |------|------|
513
- | `ai/product/product-ideas/lesa-app-remote-biometrics.md` | Lesa app: remote biometrics for agent computers |
514
- | `ai/product/bugs/2026-03-13--plaintext-sa-token-on-disk.md` | Plaintext SA token bug report |
515
-
516
- ## Status
517
-
518
- - Code deployed and running (cleanup already executed)
519
- - Not yet committed / PR'd / released
520
- - Needs: branch, commit, PR, merge, `wip-release patch`
521
-
522
- ## 0.7.15 (2026-03-13)
523
-
524
- # Dev Update: Orphan Cleanup, DELETE Trigger, Doctor Fix
525
-
526
- **Date:** 2026-03-13
527
- **Author:** CC-Mini
528
- **Session:** memory-db-fix
529
-
530
- ---
531
-
532
- ## What Happened
533
-
534
- Parker ran the Memory Crystal install prompt and `crystal doctor` reported "Embeddings: FAILING ... no provider configured in env." Investigation revealed two separate issues:
535
-
536
- ### Issue 1: Doctor False Positive
537
-
538
- `checkEmbeddingProvider()` in `doctor.ts` only checked `process.env.OPENAI_API_KEY`. But the cron job and hooks resolve the key from 1Password via the SA token at `~/.openclaw/secrets/op-sa-token`. The doctor didn't know about this path.
539
-
540
- **Fix:** Added `checkOpEmbeddings()` helper to `doctor.ts` that checks for the SA token file, then does a live `op read` to verify it works. Doctor now reports `ok: openai (via 1Password)` instead of `fail`.
541
-
542
- ### Issue 2: Orphaned Vectors and FTS Entries
543
-
544
- On 2026-03-11, 141,652 bulk file-scan chunks were correctly deleted from the `chunks` table. Parker said: "Why are we indexing documents?" These were raw file scans (Python venv packages, TypeScript source, vendor code) with no conversational context.
545
-
546
- The deletion used raw SQL (`DELETE FROM chunks WHERE agent_id = 'system'`). But Memory Crystal had no DELETE trigger. The corresponding entries in `chunks_vec` (sqlite-vec) and `chunks_fts` (FTS5) were left orphaned.
547
-
548
- **Impact:**
549
- - 141,651 orphaned vectors (~875 MB)
550
- - 141,652 orphaned FTS entries
551
- - ~7% of search queries hit phantom results (silently filtered out)
552
- - Database: 1.96 GB (should have been ~1 GB)
553
-
554
- **Fix (three parts):**
555
-
556
- 1. **DELETE trigger** added to `initChunksTables()` in `core.ts`:
557
- ```sql
558
- CREATE TRIGGER IF NOT EXISTS chunks_cleanup AFTER DELETE ON chunks
559
- BEGIN
560
- DELETE FROM chunks_vec WHERE chunk_id = OLD.id;
561
- INSERT INTO chunks_fts(chunks_fts, rowid, text) VALUES('delete', OLD.id, OLD.text);
562
- END;
563
- ```
564
-
565
- 2. **`cleanOrphans()` method** added to Crystal class in `core.ts`. Counts orphaned vec/FTS entries, deletes vec orphans in batches of 1000, rebuilds FTS5 from scratch.
566
-
567
- 3. **`crystal cleanup` CLI command** added to `cli.ts`. Handles the full workflow: backup, pause cron, clean orphans, VACUUM, resume cron. Supports `--dry-run`.
568
-
569
- **Cleanup results:**
570
- - 141,651 orphaned vectors removed
571
- - FTS rebuilt from 73,813 chunks in 5.7s
572
- - Database: 1.96 GB -> 1.45 GB (525 MB saved)
573
- - Verification: chunks = FTS entries = 73,813. Match: YES
574
- - Zero orphans remaining
575
-
576
- ### Side Discovery: Plaintext SA Token
577
-
578
- During investigation, discovered that `~/.openclaw/secrets/op-sa-token` is a plaintext 1Password SA token readable by any process running as `lesa`. This is the bootstrap credential that unlocks all secrets. Bug report filed. Long-term fix: Lesa iOS app with remote biometrics (product doc written).
579
-
580
- ### Product Rule Established
581
-
582
- Memory Crystal indexes conversations only. File content that appears in conversation turns (agent reads a file, discusses it) is captured as part of the conversation. Raw directory scanning without conversational context is not what Memory Crystal is for.
583
-
584
- ## Files Changed
585
-
586
- | File | Change |
587
- |------|--------|
588
- | `src/core.ts` | Added `chunks_cleanup` DELETE trigger, `cleanOrphans()` method |
589
- | `src/cli.ts` | Added `crystal cleanup` command, updated imports and USAGE |
590
- | `src/doctor.ts` | Added `checkOpEmbeddings()` for 1Password detection |
591
- | `ai/product/bugs/2026-03-13--orphaned-vectors-and-fts-after-bulk-delete.md` | Bug report |
592
-
593
- ## Related (wip-secrets-ios-private)
594
-
595
- | File | What |
596
- |------|------|
597
- | `ai/product/product-ideas/lesa-app-remote-biometrics.md` | Lesa app: remote biometrics for agent computers |
598
- | `ai/product/bugs/2026-03-13--plaintext-sa-token-on-disk.md` | Plaintext SA token bug report |
599
-
600
- ## Status
601
-
602
- - Code deployed and running (cleanup already executed)
603
- - Not yet committed / PR'd / released
604
- - Needs: branch, commit, PR, merge, `wip-release patch`
605
-
606
- ## 0.7.14 (2026-03-13)
607
-
608
- # Dev Update: Orphan Cleanup, DELETE Trigger, Doctor Fix
609
-
610
- **Date:** 2026-03-13
611
- **Author:** CC-Mini
612
- **Session:** memory-db-fix
613
-
614
- ---
615
-
616
- ## What Happened
617
-
618
- Parker ran the Memory Crystal install prompt and `crystal doctor` reported "Embeddings: FAILING ... no provider configured in env." Investigation revealed two separate issues:
619
-
620
- ### Issue 1: Doctor False Positive
621
-
622
- `checkEmbeddingProvider()` in `doctor.ts` only checked `process.env.OPENAI_API_KEY`. But the cron job and hooks resolve the key from 1Password via the SA token at `~/.openclaw/secrets/op-sa-token`. The doctor didn't know about this path.
623
-
624
- **Fix:** Added `checkOpEmbeddings()` helper to `doctor.ts` that checks for the SA token file, then does a live `op read` to verify it works. Doctor now reports `ok: openai (via 1Password)` instead of `fail`.
625
-
626
- ### Issue 2: Orphaned Vectors and FTS Entries
627
-
628
- On 2026-03-11, 141,652 bulk file-scan chunks were correctly deleted from the `chunks` table. Parker said: "Why are we indexing documents?" These were raw file scans (Python venv packages, TypeScript source, vendor code) with no conversational context.
629
-
630
- The deletion used raw SQL (`DELETE FROM chunks WHERE agent_id = 'system'`). But Memory Crystal had no DELETE trigger. The corresponding entries in `chunks_vec` (sqlite-vec) and `chunks_fts` (FTS5) were left orphaned.
631
-
632
- **Impact:**
633
- - 141,651 orphaned vectors (~875 MB)
634
- - 141,652 orphaned FTS entries
635
- - ~7% of search queries hit phantom results (silently filtered out)
636
- - Database: 1.96 GB (should have been ~1 GB)
637
-
638
- **Fix (three parts):**
639
-
640
- 1. **DELETE trigger** added to `initChunksTables()` in `core.ts`:
641
- ```sql
642
- CREATE TRIGGER IF NOT EXISTS chunks_cleanup AFTER DELETE ON chunks
643
- BEGIN
644
- DELETE FROM chunks_vec WHERE chunk_id = OLD.id;
645
- INSERT INTO chunks_fts(chunks_fts, rowid, text) VALUES('delete', OLD.id, OLD.text);
646
- END;
647
- ```
648
-
649
- 2. **`cleanOrphans()` method** added to Crystal class in `core.ts`. Counts orphaned vec/FTS entries, deletes vec orphans in batches of 1000, rebuilds FTS5 from scratch.
650
-
651
- 3. **`crystal cleanup` CLI command** added to `cli.ts`. Handles the full workflow: backup, pause cron, clean orphans, VACUUM, resume cron. Supports `--dry-run`.
652
-
653
- **Cleanup results:**
654
- - 141,651 orphaned vectors removed
655
- - FTS rebuilt from 73,813 chunks in 5.7s
656
- - Database: 1.96 GB -> 1.45 GB (525 MB saved)
657
- - Verification: chunks = FTS entries = 73,813. Match: YES
658
- - Zero orphans remaining
659
-
660
- ### Side Discovery: Plaintext SA Token
661
-
662
- During investigation, discovered that `~/.openclaw/secrets/op-sa-token` is a plaintext 1Password SA token readable by any process running as `lesa`. This is the bootstrap credential that unlocks all secrets. Bug report filed. Long-term fix: Lesa iOS app with remote biometrics (product doc written).
663
-
664
- ### Product Rule Established
665
-
666
- Memory Crystal indexes conversations only. File content that appears in conversation turns (agent reads a file, discusses it) is captured as part of the conversation. Raw directory scanning without conversational context is not what Memory Crystal is for.
667
-
668
- ## Files Changed
669
-
670
- | File | Change |
671
- |------|--------|
672
- | `src/core.ts` | Added `chunks_cleanup` DELETE trigger, `cleanOrphans()` method |
673
- | `src/cli.ts` | Added `crystal cleanup` command, updated imports and USAGE |
674
- | `src/doctor.ts` | Added `checkOpEmbeddings()` for 1Password detection |
675
- | `ai/product/bugs/2026-03-13--orphaned-vectors-and-fts-after-bulk-delete.md` | Bug report |
676
-
677
- ## Related (wip-secrets-ios-private)
678
-
679
- | File | What |
680
- |------|------|
681
- | `ai/product/product-ideas/lesa-app-remote-biometrics.md` | Lesa app: remote biometrics for agent computers |
682
- | `ai/product/bugs/2026-03-13--plaintext-sa-token-on-disk.md` | Plaintext SA token bug report |
683
-
684
- ## Status
685
-
686
- - Code deployed and running (cleanup already executed)
687
- - Not yet committed / PR'd / released
688
- - Needs: branch, commit, PR, merge, `wip-release patch`
689
-
690
- ## 0.7.13 (2026-03-13)
691
-
692
- # Dev Update: Orphan Cleanup, DELETE Trigger, Doctor Fix
693
-
694
- **Date:** 2026-03-13
695
- **Author:** CC-Mini
696
- **Session:** memory-db-fix
697
-
698
- ---
699
-
700
- ## What Happened
701
-
702
- Parker ran the Memory Crystal install prompt and `crystal doctor` reported "Embeddings: FAILING ... no provider configured in env." Investigation revealed two separate issues:
703
-
704
- ### Issue 1: Doctor False Positive
705
-
706
- `checkEmbeddingProvider()` in `doctor.ts` only checked `process.env.OPENAI_API_KEY`. But the cron job and hooks resolve the key from 1Password via the SA token at `~/.openclaw/secrets/op-sa-token`. The doctor didn't know about this path.
707
-
708
- **Fix:** Added `checkOpEmbeddings()` helper to `doctor.ts` that checks for the SA token file, then does a live `op read` to verify it works. Doctor now reports `ok: openai (via 1Password)` instead of `fail`.
709
-
710
- ### Issue 2: Orphaned Vectors and FTS Entries
711
-
712
- On 2026-03-11, 141,652 bulk file-scan chunks were correctly deleted from the `chunks` table. Parker said: "Why are we indexing documents?" These were raw file scans (Python venv packages, TypeScript source, vendor code) with no conversational context.
713
-
714
- The deletion used raw SQL (`DELETE FROM chunks WHERE agent_id = 'system'`). But Memory Crystal had no DELETE trigger. The corresponding entries in `chunks_vec` (sqlite-vec) and `chunks_fts` (FTS5) were left orphaned.
715
-
716
- **Impact:**
717
- - 141,651 orphaned vectors (~875 MB)
718
- - 141,652 orphaned FTS entries
719
- - ~7% of search queries hit phantom results (silently filtered out)
720
- - Database: 1.96 GB (should have been ~1 GB)
721
-
722
- **Fix (three parts):**
723
-
724
- 1. **DELETE trigger** added to `initChunksTables()` in `core.ts`:
725
- ```sql
726
- CREATE TRIGGER IF NOT EXISTS chunks_cleanup AFTER DELETE ON chunks
727
- BEGIN
728
- DELETE FROM chunks_vec WHERE chunk_id = OLD.id;
729
- INSERT INTO chunks_fts(chunks_fts, rowid, text) VALUES('delete', OLD.id, OLD.text);
730
- END;
731
- ```
732
-
733
- 2. **`cleanOrphans()` method** added to Crystal class in `core.ts`. Counts orphaned vec/FTS entries, deletes vec orphans in batches of 1000, rebuilds FTS5 from scratch.
734
-
735
- 3. **`crystal cleanup` CLI command** added to `cli.ts`. Handles the full workflow: backup, pause cron, clean orphans, VACUUM, resume cron. Supports `--dry-run`.
736
-
737
- **Cleanup results:**
738
- - 141,651 orphaned vectors removed
739
- - FTS rebuilt from 73,813 chunks in 5.7s
740
- - Database: 1.96 GB -> 1.45 GB (525 MB saved)
741
- - Verification: chunks = FTS entries = 73,813. Match: YES
742
- - Zero orphans remaining
743
-
744
- ### Side Discovery: Plaintext SA Token
745
-
746
- During investigation, discovered that `~/.openclaw/secrets/op-sa-token` is a plaintext 1Password SA token readable by any process running as `lesa`. This is the bootstrap credential that unlocks all secrets. Bug report filed. Long-term fix: Lesa iOS app with remote biometrics (product doc written).
747
-
748
- ### Product Rule Established
749
-
750
- Memory Crystal indexes conversations only. File content that appears in conversation turns (agent reads a file, discusses it) is captured as part of the conversation. Raw directory scanning without conversational context is not what Memory Crystal is for.
751
-
752
- ## Files Changed
753
-
754
- | File | Change |
755
- |------|--------|
756
- | `src/core.ts` | Added `chunks_cleanup` DELETE trigger, `cleanOrphans()` method |
757
- | `src/cli.ts` | Added `crystal cleanup` command, updated imports and USAGE |
758
- | `src/doctor.ts` | Added `checkOpEmbeddings()` for 1Password detection |
759
- | `ai/product/bugs/2026-03-13--orphaned-vectors-and-fts-after-bulk-delete.md` | Bug report |
760
-
761
- ## Related (wip-secrets-ios-private)
762
-
763
- | File | What |
764
- |------|------|
765
- | `ai/product/product-ideas/lesa-app-remote-biometrics.md` | Lesa app: remote biometrics for agent computers |
766
- | `ai/product/bugs/2026-03-13--plaintext-sa-token-on-disk.md` | Plaintext SA token bug report |
767
-
768
- ## Status
769
-
770
- - Code deployed and running (cleanup already executed)
771
- - Not yet committed / PR'd / released
772
- - Needs: branch, commit, PR, merge, `wip-release patch`
773
-
774
- ## 0.7.12 (2026-03-13)
775
-
776
- # Dev Update: Orphan Cleanup, DELETE Trigger, Doctor Fix
777
-
778
- **Date:** 2026-03-13
779
- **Author:** CC-Mini
780
- **Session:** memory-db-fix
781
-
782
- ---
783
-
784
- ## What Happened
785
-
786
- Parker ran the Memory Crystal install prompt and `crystal doctor` reported "Embeddings: FAILING ... no provider configured in env." Investigation revealed two separate issues:
787
-
788
- ### Issue 1: Doctor False Positive
789
-
790
- `checkEmbeddingProvider()` in `doctor.ts` only checked `process.env.OPENAI_API_KEY`. But the cron job and hooks resolve the key from 1Password via the SA token at `~/.openclaw/secrets/op-sa-token`. The doctor didn't know about this path.
791
-
792
- **Fix:** Added `checkOpEmbeddings()` helper to `doctor.ts` that checks for the SA token file, then does a live `op read` to verify it works. Doctor now reports `ok: openai (via 1Password)` instead of `fail`.
793
-
794
- ### Issue 2: Orphaned Vectors and FTS Entries
795
-
796
- On 2026-03-11, 141,652 bulk file-scan chunks were correctly deleted from the `chunks` table. Parker said: "Why are we indexing documents?" These were raw file scans (Python venv packages, TypeScript source, vendor code) with no conversational context.
797
-
798
- The deletion used raw SQL (`DELETE FROM chunks WHERE agent_id = 'system'`). But Memory Crystal had no DELETE trigger. The corresponding entries in `chunks_vec` (sqlite-vec) and `chunks_fts` (FTS5) were left orphaned.
799
-
800
- **Impact:**
801
- - 141,651 orphaned vectors (~875 MB)
802
- - 141,652 orphaned FTS entries
803
- - ~7% of search queries hit phantom results (silently filtered out)
804
- - Database: 1.96 GB (should have been ~1 GB)
805
-
806
- **Fix (three parts):**
807
-
808
- 1. **DELETE trigger** added to `initChunksTables()` in `core.ts`:
809
- ```sql
810
- CREATE TRIGGER IF NOT EXISTS chunks_cleanup AFTER DELETE ON chunks
811
- BEGIN
812
- DELETE FROM chunks_vec WHERE chunk_id = OLD.id;
813
- INSERT INTO chunks_fts(chunks_fts, rowid, text) VALUES('delete', OLD.id, OLD.text);
814
- END;
815
- ```
816
-
817
- 2. **`cleanOrphans()` method** added to Crystal class in `core.ts`. Counts orphaned vec/FTS entries, deletes vec orphans in batches of 1000, rebuilds FTS5 from scratch.
818
-
819
- 3. **`crystal cleanup` CLI command** added to `cli.ts`. Handles the full workflow: backup, pause cron, clean orphans, VACUUM, resume cron. Supports `--dry-run`.
820
-
821
- **Cleanup results:**
822
- - 141,651 orphaned vectors removed
823
- - FTS rebuilt from 73,813 chunks in 5.7s
824
- - Database: 1.96 GB -> 1.45 GB (525 MB saved)
825
- - Verification: chunks = FTS entries = 73,813. Match: YES
826
- - Zero orphans remaining
827
-
828
- ### Side Discovery: Plaintext SA Token
829
-
830
- During investigation, discovered that `~/.openclaw/secrets/op-sa-token` is a plaintext 1Password SA token readable by any process running as `lesa`. This is the bootstrap credential that unlocks all secrets. Bug report filed. Long-term fix: Lesa iOS app with remote biometrics (product doc written).
831
-
832
- ### Product Rule Established
833
-
834
- Memory Crystal indexes conversations only. File content that appears in conversation turns (agent reads a file, discusses it) is captured as part of the conversation. Raw directory scanning without conversational context is not what Memory Crystal is for.
835
-
836
- ## Files Changed
837
-
838
- | File | Change |
839
- |------|--------|
840
- | `src/core.ts` | Added `chunks_cleanup` DELETE trigger, `cleanOrphans()` method |
841
- | `src/cli.ts` | Added `crystal cleanup` command, updated imports and USAGE |
842
- | `src/doctor.ts` | Added `checkOpEmbeddings()` for 1Password detection |
843
- | `ai/product/bugs/2026-03-13--orphaned-vectors-and-fts-after-bulk-delete.md` | Bug report |
844
-
845
- ## Related (wip-secrets-ios-private)
846
-
847
- | File | What |
848
- |------|------|
849
- | `ai/product/product-ideas/lesa-app-remote-biometrics.md` | Lesa app: remote biometrics for agent computers |
850
- | `ai/product/bugs/2026-03-13--plaintext-sa-token-on-disk.md` | Plaintext SA token bug report |
851
-
852
- ## Status
853
-
854
- - Code deployed and running (cleanup already executed)
855
- - Not yet committed / PR'd / released
856
- - Needs: branch, commit, PR, merge, `wip-release patch`
857
-
858
- ## 0.7.11 (2026-03-13)
859
-
860
- # Dev Update: Orphan Cleanup, DELETE Trigger, Doctor Fix
861
-
862
- **Date:** 2026-03-13
863
- **Author:** CC-Mini
864
- **Session:** memory-db-fix
865
-
866
- ---
867
-
868
- ## What Happened
869
-
870
- Parker ran the Memory Crystal install prompt and `crystal doctor` reported "Embeddings: FAILING ... no provider configured in env." Investigation revealed two separate issues:
871
-
872
- ### Issue 1: Doctor False Positive
873
-
874
- `checkEmbeddingProvider()` in `doctor.ts` only checked `process.env.OPENAI_API_KEY`. But the cron job and hooks resolve the key from 1Password via the SA token at `~/.openclaw/secrets/op-sa-token`. The doctor didn't know about this path.
875
-
876
- **Fix:** Added `checkOpEmbeddings()` helper to `doctor.ts` that checks for the SA token file, then does a live `op read` to verify it works. Doctor now reports `ok: openai (via 1Password)` instead of `fail`.
877
-
878
- ### Issue 2: Orphaned Vectors and FTS Entries
879
-
880
- On 2026-03-11, 141,652 bulk file-scan chunks were correctly deleted from the `chunks` table. Parker said: "Why are we indexing documents?" These were raw file scans (Python venv packages, TypeScript source, vendor code) with no conversational context.
881
-
882
- The deletion used raw SQL (`DELETE FROM chunks WHERE agent_id = 'system'`). But Memory Crystal had no DELETE trigger. The corresponding entries in `chunks_vec` (sqlite-vec) and `chunks_fts` (FTS5) were left orphaned.
883
-
884
- **Impact:**
885
- - 141,651 orphaned vectors (~875 MB)
886
- - 141,652 orphaned FTS entries
887
- - ~7% of search queries hit phantom results (silently filtered out)
888
- - Database: 1.96 GB (should have been ~1 GB)
889
-
890
- **Fix (three parts):**
891
-
892
- 1. **DELETE trigger** added to `initChunksTables()` in `core.ts`:
893
- ```sql
894
- CREATE TRIGGER IF NOT EXISTS chunks_cleanup AFTER DELETE ON chunks
895
- BEGIN
896
- DELETE FROM chunks_vec WHERE chunk_id = OLD.id;
897
- INSERT INTO chunks_fts(chunks_fts, rowid, text) VALUES('delete', OLD.id, OLD.text);
898
- END;
899
- ```
900
-
901
- 2. **`cleanOrphans()` method** added to Crystal class in `core.ts`. Counts orphaned vec/FTS entries, deletes vec orphans in batches of 1000, rebuilds FTS5 from scratch.
902
-
903
- 3. **`crystal cleanup` CLI command** added to `cli.ts`. Handles the full workflow: backup, pause cron, clean orphans, VACUUM, resume cron. Supports `--dry-run`.
904
-
905
- **Cleanup results:**
906
- - 141,651 orphaned vectors removed
907
- - FTS rebuilt from 73,813 chunks in 5.7s
908
- - Database: 1.96 GB -> 1.45 GB (525 MB saved)
909
- - Verification: chunks = FTS entries = 73,813. Match: YES
910
- - Zero orphans remaining
911
-
912
- ### Side Discovery: Plaintext SA Token
913
-
914
- During investigation, discovered that `~/.openclaw/secrets/op-sa-token` is a plaintext 1Password SA token readable by any process running as `lesa`. This is the bootstrap credential that unlocks all secrets. Bug report filed. Long-term fix: Lesa iOS app with remote biometrics (product doc written).
915
-
916
- ### Product Rule Established
917
-
918
- Memory Crystal indexes conversations only. File content that appears in conversation turns (agent reads a file, discusses it) is captured as part of the conversation. Raw directory scanning without conversational context is not what Memory Crystal is for.
919
-
920
- ## Files Changed
921
-
922
- | File | Change |
923
- |------|--------|
924
- | `src/core.ts` | Added `chunks_cleanup` DELETE trigger, `cleanOrphans()` method |
925
- | `src/cli.ts` | Added `crystal cleanup` command, updated imports and USAGE |
926
- | `src/doctor.ts` | Added `checkOpEmbeddings()` for 1Password detection |
927
- | `ai/product/bugs/2026-03-13--orphaned-vectors-and-fts-after-bulk-delete.md` | Bug report |
928
-
929
- ## Related (wip-secrets-ios-private)
930
-
931
- | File | What |
932
- |------|------|
933
- | `ai/product/product-ideas/lesa-app-remote-biometrics.md` | Lesa app: remote biometrics for agent computers |
934
- | `ai/product/bugs/2026-03-13--plaintext-sa-token-on-disk.md` | Plaintext SA token bug report |
935
-
936
- ## Status
937
-
938
- - Code deployed and running (cleanup already executed)
939
- - Not yet committed / PR'd / released
940
- - Needs: branch, commit, PR, merge, `wip-release patch`
941
-
942
- ## 0.7.10 (2026-03-13)
943
-
944
- # Dev Update: Orphan Cleanup, DELETE Trigger, Doctor Fix
945
-
946
- **Date:** 2026-03-13
947
- **Author:** CC-Mini
948
- **Session:** memory-db-fix
949
-
950
- ---
951
-
952
- ## What Happened
953
-
954
- Parker ran the Memory Crystal install prompt and `crystal doctor` reported "Embeddings: FAILING ... no provider configured in env." Investigation revealed two separate issues:
955
-
956
- ### Issue 1: Doctor False Positive
957
-
958
- `checkEmbeddingProvider()` in `doctor.ts` only checked `process.env.OPENAI_API_KEY`. But the cron job and hooks resolve the key from 1Password via the SA token at `~/.openclaw/secrets/op-sa-token`. The doctor didn't know about this path.
959
-
960
- **Fix:** Added `checkOpEmbeddings()` helper to `doctor.ts` that checks for the SA token file, then does a live `op read` to verify it works. Doctor now reports `ok: openai (via 1Password)` instead of `fail`.
961
-
962
- ### Issue 2: Orphaned Vectors and FTS Entries
963
-
964
- On 2026-03-11, 141,652 bulk file-scan chunks were correctly deleted from the `chunks` table. Parker said: "Why are we indexing documents?" These were raw file scans (Python venv packages, TypeScript source, vendor code) with no conversational context.
965
-
966
- The deletion used raw SQL (`DELETE FROM chunks WHERE agent_id = 'system'`). But Memory Crystal had no DELETE trigger. The corresponding entries in `chunks_vec` (sqlite-vec) and `chunks_fts` (FTS5) were left orphaned.
967
-
968
- **Impact:**
969
- - 141,651 orphaned vectors (~875 MB)
970
- - 141,652 orphaned FTS entries
971
- - ~7% of search queries hit phantom results (silently filtered out)
972
- - Database: 1.96 GB (should have been ~1 GB)
973
-
974
- **Fix (three parts):**
975
-
976
- 1. **DELETE trigger** added to `initChunksTables()` in `core.ts`:
977
- ```sql
978
- CREATE TRIGGER IF NOT EXISTS chunks_cleanup AFTER DELETE ON chunks
979
- BEGIN
980
- DELETE FROM chunks_vec WHERE chunk_id = OLD.id;
981
- INSERT INTO chunks_fts(chunks_fts, rowid, text) VALUES('delete', OLD.id, OLD.text);
982
- END;
983
- ```
984
-
985
- 2. **`cleanOrphans()` method** added to Crystal class in `core.ts`. Counts orphaned vec/FTS entries, deletes vec orphans in batches of 1000, rebuilds FTS5 from scratch.
986
-
987
- 3. **`crystal cleanup` CLI command** added to `cli.ts`. Handles the full workflow: backup, pause cron, clean orphans, VACUUM, resume cron. Supports `--dry-run`.
988
-
989
- **Cleanup results:**
990
- - 141,651 orphaned vectors removed
991
- - FTS rebuilt from 73,813 chunks in 5.7s
992
- - Database: 1.96 GB -> 1.45 GB (525 MB saved)
993
- - Verification: chunks = FTS entries = 73,813. Match: YES
994
- - Zero orphans remaining
995
-
996
- ### Side Discovery: Plaintext SA Token
997
-
998
- During investigation, discovered that `~/.openclaw/secrets/op-sa-token` is a plaintext 1Password SA token readable by any process running as `lesa`. This is the bootstrap credential that unlocks all secrets. Bug report filed. Long-term fix: Lesa iOS app with remote biometrics (product doc written).
999
-
1000
- ### Product Rule Established
1001
-
1002
- Memory Crystal indexes conversations only. File content that appears in conversation turns (agent reads a file, discusses it) is captured as part of the conversation. Raw directory scanning without conversational context is not what Memory Crystal is for.
1003
-
1004
- ## Files Changed
1005
-
1006
- | File | Change |
1007
- |------|--------|
1008
- | `src/core.ts` | Added `chunks_cleanup` DELETE trigger, `cleanOrphans()` method |
1009
- | `src/cli.ts` | Added `crystal cleanup` command, updated imports and USAGE |
1010
- | `src/doctor.ts` | Added `checkOpEmbeddings()` for 1Password detection |
1011
- | `ai/product/bugs/2026-03-13--orphaned-vectors-and-fts-after-bulk-delete.md` | Bug report |
1012
-
1013
- ## Related (wip-secrets-ios-private)
1014
-
1015
- | File | What |
1016
- |------|------|
1017
- | `ai/product/product-ideas/lesa-app-remote-biometrics.md` | Lesa app: remote biometrics for agent computers |
1018
- | `ai/product/bugs/2026-03-13--plaintext-sa-token-on-disk.md` | Plaintext SA token bug report |
1019
-
1020
- ## Status
1021
-
1022
- - Code deployed and running (cleanup already executed)
1023
- - Not yet committed / PR'd / released
1024
- - Needs: branch, commit, PR, merge, `wip-release patch`
1025
-
1026
- ## 0.7.9 (2026-03-13)
1027
-
1028
- # Dev Update: Orphan Cleanup, DELETE Trigger, Doctor Fix
1029
-
1030
- **Date:** 2026-03-13
1031
- **Author:** CC-Mini
1032
- **Session:** memory-db-fix
1033
-
1034
- ---
1035
-
1036
- ## What Happened
1037
-
1038
- Parker ran the Memory Crystal install prompt and `crystal doctor` reported "Embeddings: FAILING ... no provider configured in env." Investigation revealed two separate issues:
1039
-
1040
- ### Issue 1: Doctor False Positive
1041
-
1042
- `checkEmbeddingProvider()` in `doctor.ts` only checked `process.env.OPENAI_API_KEY`. But the cron job and hooks resolve the key from 1Password via the SA token at `~/.openclaw/secrets/op-sa-token`. The doctor didn't know about this path.
1043
-
1044
- **Fix:** Added `checkOpEmbeddings()` helper to `doctor.ts` that checks for the SA token file, then does a live `op read` to verify it works. Doctor now reports `ok: openai (via 1Password)` instead of `fail`.
1045
-
1046
- ### Issue 2: Orphaned Vectors and FTS Entries
1047
-
1048
- On 2026-03-11, 141,652 bulk file-scan chunks were correctly deleted from the `chunks` table. Parker said: "Why are we indexing documents?" These were raw file scans (Python venv packages, TypeScript source, vendor code) with no conversational context.
1049
-
1050
- The deletion used raw SQL (`DELETE FROM chunks WHERE agent_id = 'system'`). But Memory Crystal had no DELETE trigger. The corresponding entries in `chunks_vec` (sqlite-vec) and `chunks_fts` (FTS5) were left orphaned.
1051
-
1052
- **Impact:**
1053
- - 141,651 orphaned vectors (~875 MB)
1054
- - 141,652 orphaned FTS entries
1055
- - ~7% of search queries hit phantom results (silently filtered out)
1056
- - Database: 1.96 GB (should have been ~1 GB)
1057
-
1058
- **Fix (three parts):**
1059
-
1060
- 1. **DELETE trigger** added to `initChunksTables()` in `core.ts`:
1061
- ```sql
1062
- CREATE TRIGGER IF NOT EXISTS chunks_cleanup AFTER DELETE ON chunks
1063
- BEGIN
1064
- DELETE FROM chunks_vec WHERE chunk_id = OLD.id;
1065
- INSERT INTO chunks_fts(chunks_fts, rowid, text) VALUES('delete', OLD.id, OLD.text);
1066
- END;
1067
- ```
1068
-
1069
- 2. **`cleanOrphans()` method** added to Crystal class in `core.ts`. Counts orphaned vec/FTS entries, deletes vec orphans in batches of 1000, rebuilds FTS5 from scratch.
1070
-
1071
- 3. **`crystal cleanup` CLI command** added to `cli.ts`. Handles the full workflow: backup, pause cron, clean orphans, VACUUM, resume cron. Supports `--dry-run`.
1072
-
1073
- **Cleanup results:**
1074
- - 141,651 orphaned vectors removed
1075
- - FTS rebuilt from 73,813 chunks in 5.7s
1076
- - Database: 1.96 GB -> 1.45 GB (525 MB saved)
1077
- - Verification: chunks = FTS entries = 73,813. Match: YES
1078
- - Zero orphans remaining
1079
-
1080
- ### Side Discovery: Plaintext SA Token
1081
-
1082
- During investigation, discovered that `~/.openclaw/secrets/op-sa-token` is a plaintext 1Password SA token readable by any process running as `lesa`. This is the bootstrap credential that unlocks all secrets. Bug report filed. Long-term fix: Lesa iOS app with remote biometrics (product doc written).
1083
-
1084
- ### Product Rule Established
1085
-
1086
- Memory Crystal indexes conversations only. File content that appears in conversation turns (agent reads a file, discusses it) is captured as part of the conversation. Raw directory scanning without conversational context is not what Memory Crystal is for.
1087
-
1088
- ## Files Changed
1089
-
1090
- | File | Change |
1091
- |------|--------|
1092
- | `src/core.ts` | Added `chunks_cleanup` DELETE trigger, `cleanOrphans()` method |
1093
- | `src/cli.ts` | Added `crystal cleanup` command, updated imports and USAGE |
1094
- | `src/doctor.ts` | Added `checkOpEmbeddings()` for 1Password detection |
1095
- | `ai/product/bugs/2026-03-13--orphaned-vectors-and-fts-after-bulk-delete.md` | Bug report |
1096
-
1097
- ## Related (wip-secrets-ios-private)
1098
-
1099
- | File | What |
1100
- |------|------|
1101
- | `ai/product/product-ideas/lesa-app-remote-biometrics.md` | Lesa app: remote biometrics for agent computers |
1102
- | `ai/product/bugs/2026-03-13--plaintext-sa-token-on-disk.md` | Plaintext SA token bug report |
1103
-
1104
- ## Status
1105
-
1106
- - Code deployed and running (cleanup already executed)
1107
- - Not yet committed / PR'd / released
1108
- - Needs: branch, commit, PR, merge, `wip-release patch`
1109
-
1110
- ## 0.7.8 (2026-03-13)
1111
-
1112
- # Dev Update: Orphan Cleanup, DELETE Trigger, Doctor Fix
1113
-
1114
- **Date:** 2026-03-13
1115
- **Author:** CC-Mini
1116
- **Session:** memory-db-fix
1117
-
1118
- ---
1119
-
1120
- ## What Happened
1121
-
1122
- Parker ran the Memory Crystal install prompt and `crystal doctor` reported "Embeddings: FAILING ... no provider configured in env." Investigation revealed two separate issues:
1123
-
1124
- ### Issue 1: Doctor False Positive
1125
-
1126
- `checkEmbeddingProvider()` in `doctor.ts` only checked `process.env.OPENAI_API_KEY`. But the cron job and hooks resolve the key from 1Password via the SA token at `~/.openclaw/secrets/op-sa-token`. The doctor didn't know about this path.
1127
-
1128
- **Fix:** Added `checkOpEmbeddings()` helper to `doctor.ts` that checks for the SA token file, then does a live `op read` to verify it works. Doctor now reports `ok: openai (via 1Password)` instead of `fail`.
1129
-
1130
- ### Issue 2: Orphaned Vectors and FTS Entries
1131
-
1132
- On 2026-03-11, 141,652 bulk file-scan chunks were correctly deleted from the `chunks` table. Parker said: "Why are we indexing documents?" These were raw file scans (Python venv packages, TypeScript source, vendor code) with no conversational context.
1133
-
1134
- The deletion used raw SQL (`DELETE FROM chunks WHERE agent_id = 'system'`). But Memory Crystal had no DELETE trigger. The corresponding entries in `chunks_vec` (sqlite-vec) and `chunks_fts` (FTS5) were left orphaned.
1135
-
1136
- **Impact:**
1137
- - 141,651 orphaned vectors (~875 MB)
1138
- - 141,652 orphaned FTS entries
1139
- - ~7% of search queries hit phantom results (silently filtered out)
1140
- - Database: 1.96 GB (should have been ~1 GB)
1141
-
1142
- **Fix (three parts):**
1143
-
1144
- 1. **DELETE trigger** added to `initChunksTables()` in `core.ts`:
1145
- ```sql
1146
- CREATE TRIGGER IF NOT EXISTS chunks_cleanup AFTER DELETE ON chunks
1147
- BEGIN
1148
- DELETE FROM chunks_vec WHERE chunk_id = OLD.id;
1149
- INSERT INTO chunks_fts(chunks_fts, rowid, text) VALUES('delete', OLD.id, OLD.text);
1150
- END;
1151
- ```
1152
-
1153
- 2. **`cleanOrphans()` method** added to Crystal class in `core.ts`. Counts orphaned vec/FTS entries, deletes vec orphans in batches of 1000, rebuilds FTS5 from scratch.
1154
-
1155
- 3. **`crystal cleanup` CLI command** added to `cli.ts`. Handles the full workflow: backup, pause cron, clean orphans, VACUUM, resume cron. Supports `--dry-run`.
1156
-
1157
- **Cleanup results:**
1158
- - 141,651 orphaned vectors removed
1159
- - FTS rebuilt from 73,813 chunks in 5.7s
1160
- - Database: 1.96 GB -> 1.45 GB (525 MB saved)
1161
- - Verification: chunks = FTS entries = 73,813. Match: YES
1162
- - Zero orphans remaining
1163
-
1164
- ### Side Discovery: Plaintext SA Token
1165
-
1166
- During investigation, discovered that `~/.openclaw/secrets/op-sa-token` is a plaintext 1Password SA token readable by any process running as `lesa`. This is the bootstrap credential that unlocks all secrets. Bug report filed. Long-term fix: Lesa iOS app with remote biometrics (product doc written).
1167
-
1168
- ### Product Rule Established
1169
-
1170
- Memory Crystal indexes conversations only. File content that appears in conversation turns (agent reads a file, discusses it) is captured as part of the conversation. Raw directory scanning without conversational context is not what Memory Crystal is for.
1171
-
1172
- ## Files Changed
1173
-
1174
- | File | Change |
1175
- |------|--------|
1176
- | `src/core.ts` | Added `chunks_cleanup` DELETE trigger, `cleanOrphans()` method |
1177
- | `src/cli.ts` | Added `crystal cleanup` command, updated imports and USAGE |
1178
- | `src/doctor.ts` | Added `checkOpEmbeddings()` for 1Password detection |
1179
- | `ai/product/bugs/2026-03-13--orphaned-vectors-and-fts-after-bulk-delete.md` | Bug report |
1180
-
1181
- ## Related (wip-secrets-ios-private)
1182
-
1183
- | File | What |
1184
- |------|------|
1185
- | `ai/product/product-ideas/lesa-app-remote-biometrics.md` | Lesa app: remote biometrics for agent computers |
1186
- | `ai/product/bugs/2026-03-13--plaintext-sa-token-on-disk.md` | Plaintext SA token bug report |
1187
-
1188
- ## Status
1189
-
1190
- - Code deployed and running (cleanup already executed)
1191
- - Not yet committed / PR'd / released
1192
- - Needs: branch, commit, PR, merge, `wip-release patch`
1193
-
1194
- ## 0.7.7 (2026-03-13)
1195
-
1196
- Update install prompt to new standard format. Replaces old 3-question prompt with 4 explain questions, installed check, and dry-run before install.
1197
-
1198
- ## 0.7.6 (2026-03-13)
1199
-
1200
- Update LDM delegation tips
1201
-
1202
- ## 0.7.5 (2026-03-13)
1203
-
1204
- # Release Notes: Memory Crystal v0.7.5
1205
-
1206
- ## LDM OS Integration
1207
-
1208
- Memory Crystal now works with LDM OS when it's available.
1209
-
1210
- ### crystal init delegates to ldm install
1211
-
1212
- When the `ldm` CLI exists on PATH, `crystal init` delegates generic deployment to it. LDM OS handles the scaffold, interface detection, and extension deployment. Memory Crystal keeps its own setup: database backup, role configuration, pairing, cron jobs.
1213
-
1214
- When `ldm` isn't available, `crystal init` works standalone like it always has. No new dependencies. No breaking changes.
1215
-
1216
- ### LDM OS tip
1217
-
1218
- After install completes, Memory Crystal prints a tip: "Run `ldm install` to see more skills you can add." Helps users discover the rest of the ecosystem.
1219
-
1220
- ### Part of LDM OS
1221
-
1222
- README now includes a "Part of LDM OS" section linking back to the LDM OS repo. Memory Crystal installs into LDM OS, the local runtime for AI agents.
1223
-
1224
- ## 0.7.4 (2026-03-11)
1225
-
1226
- MCP fix (OPENCLAW_HOME env var), AgentId reads from LDM config instead of hardcoding, MCP registrations moved to user-level, 33 stale branches renamed, QMD v1.1.6 analysis documented
1227
-
1228
- ## 0.7.3 (2026-03-10)
1229
-
1230
- Fix MCP registration to include OPENCLAW_HOME env var for memory-crystal MCP server
1231
-
1232
- ## 0.7.2 (2026-03-05)
1233
-
1234
- Fix MCP detection in doctor and installer to check project-level and user-scope registrations
1235
-
1236
- ## 0.7.1 (2026-03-05)
1237
-
1238
- Database backup, verification, and import in installer
1239
-
1240
- ## 0.7.0 (2026-03-05)
1241
-
1242
- Delta sync, file sync, intelligent install & update
1243
-
1244
- ## 0.6.1 (2026-03-05)
1245
-
1246
- Search quality: deep search with LLM query expansion + re-ranking, MCP sampling design, updated docs
1247
-
1248
- ## 0.6.0 (2026-03-04)
1249
-
1250
- Dream Weaver integration, Crystal Core gateway, staging pipeline, commands channel.
1251
-
1252
- - Dream Weaver narrative consolidation via `crystal dream-weave` (imports engine from dream-weaver-protocol)
1253
- - Crystal Core gateway (`crystal serve`) on localhost:18790, OpenAI-compatible endpoint
1254
- - Staging pipeline for new agents from relay (auto-detect, stage, backfill, dream-weave)
1255
- - Commands channel on relay Worker (nodes send commands to Core, Core sends results back)
1256
- - OpenClaw raw data sync to LDM after every agent_end turn (sessions, workspace, daily logs)
1257
- - Relay command support in cc-hook.ts (`sendCommand()` export)
1258
- - Harness-aware init flow (OpenClaw vs Claude Code, Core vs Node)
1259
- - Poller now detects new agents and routes to staging before live ingest
1260
-
1261
- ## 0.5.0 (2026-03-04)
1262
-
1263
- Init discovery, bulk copy, OpenClaw parser, backfill, CE migration. Reorganize ai/ to ai/product/.
1264
-
1265
- - `crystal init` discovers session files on the current machine (Claude Code + OpenClaw)
1266
- - `crystal backfill` embeds raw transcript files from LDM (Core: local embed, Node: relay to Core)
1267
- - `crystal migrate-embeddings` migrates context-embeddings.sqlite chunks into crystal.db ($0, copies embeddings directly)
1268
- - `src/discover.ts` auto-detects installed harnesses and session file locations
1269
- - `src/bulk-copy.ts` copies raw files to LDM transcripts (idempotent, skip if same size)
1270
- - `src/oc-backfill.ts` parses OpenClaw JSONL format into standard message format
1271
- - Workspace path added to LDM (`~/.ldm/agents/{id}/memory/workspace/`)
1272
-
1273
-
1274
-
1275
- ## 0.4.1 (2026-03-03)
1276
-
1277
- Crystal Core/Node architecture, crystal doctor, crystal backup, crystal bridge, SKILL.md onboarding rewrite
1278
-
1279
- ## 0.3.3 (2026-03-02)
1280
-
1281
- Fix bin entries: crystal and crystal-mcp commands were missing from v0.3.2 due to npm stripping ./ prefix paths
1282
-
1283
- ## 0.3.2 (2026-03-02)
1284
-
1285
- Rewrite SKILL.md as complete agent install guide. Add crystal-mcp binary for clean MCP config. CLI search output matches MCP server (freshness icons, numbered results). Agents can now auto-detect and install for Claude Code CLI, Claude Desktop, and OpenClaw.
1286
-
1287
- ## 0.3.1 (2026-03-02)
1288
-
1289
- Fix npm package: exclude ai/ folder from published tarball
1290
-
1291
- ## 0.3.0 (2026-03-02)
1292
-
1293
- Phase 1 continuous capture, Cloud MCP server, QR pairing, crystal init, docs overhaul
1294
-
1295
- ## 0.2.0 (2026-02-28)
1296
-
1297
- README overhaul, relay encryption, QR pairing spec, Grok/Lesa feedback, disable auto dev-updates