@wipcomputer/memory-crystal 0.7.30 → 0.7.33

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