@psiclawops/hypermem 0.8.5 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/INSTALL.md +132 -9
  3. package/README.md +119 -272
  4. package/bench/README.md +42 -0
  5. package/bench/data-access-bench.mjs +380 -0
  6. package/bin/hypermem-bench.mjs +2 -0
  7. package/bin/hypermem-doctor.mjs +412 -0
  8. package/bin/hypermem-model-audit.mjs +339 -0
  9. package/bin/hypermem-status.mjs +491 -70
  10. package/dist/adaptive-lifecycle.d.ts +81 -0
  11. package/dist/adaptive-lifecycle.d.ts.map +1 -0
  12. package/dist/adaptive-lifecycle.js +190 -0
  13. package/dist/budget-policy.d.ts +1 -1
  14. package/dist/budget-policy.d.ts.map +1 -1
  15. package/dist/budget-policy.js +10 -5
  16. package/dist/cache.d.ts +1 -0
  17. package/dist/cache.d.ts.map +1 -1
  18. package/dist/cache.js +2 -0
  19. package/dist/composition-snapshot-integrity.d.ts +36 -0
  20. package/dist/composition-snapshot-integrity.d.ts.map +1 -0
  21. package/dist/composition-snapshot-integrity.js +131 -0
  22. package/dist/composition-snapshot-runtime.d.ts +59 -0
  23. package/dist/composition-snapshot-runtime.d.ts.map +1 -0
  24. package/dist/composition-snapshot-runtime.js +250 -0
  25. package/dist/composition-snapshot-store.d.ts +44 -0
  26. package/dist/composition-snapshot-store.d.ts.map +1 -0
  27. package/dist/composition-snapshot-store.js +117 -0
  28. package/dist/compositor.d.ts +125 -1
  29. package/dist/compositor.d.ts.map +1 -1
  30. package/dist/compositor.js +692 -44
  31. package/dist/doc-chunk-store.d.ts +19 -0
  32. package/dist/doc-chunk-store.d.ts.map +1 -1
  33. package/dist/doc-chunk-store.js +56 -6
  34. package/dist/hybrid-retrieval.d.ts +38 -0
  35. package/dist/hybrid-retrieval.d.ts.map +1 -1
  36. package/dist/hybrid-retrieval.js +86 -1
  37. package/dist/index.d.ts +12 -3
  38. package/dist/index.d.ts.map +1 -1
  39. package/dist/index.js +28 -2
  40. package/dist/knowledge-store.d.ts +4 -1
  41. package/dist/knowledge-store.d.ts.map +1 -1
  42. package/dist/knowledge-store.js +27 -4
  43. package/dist/library-schema.d.ts +12 -8
  44. package/dist/library-schema.d.ts.map +1 -1
  45. package/dist/library-schema.js +22 -8
  46. package/dist/message-store.d.ts.map +1 -1
  47. package/dist/message-store.js +7 -3
  48. package/dist/metrics-dashboard.d.ts +18 -1
  49. package/dist/metrics-dashboard.d.ts.map +1 -1
  50. package/dist/metrics-dashboard.js +52 -14
  51. package/dist/reranker.d.ts +1 -1
  52. package/dist/reranker.js +2 -2
  53. package/dist/schema.d.ts +1 -1
  54. package/dist/schema.d.ts.map +1 -1
  55. package/dist/schema.js +28 -1
  56. package/dist/seed.d.ts.map +1 -1
  57. package/dist/seed.js +2 -0
  58. package/dist/topic-synthesizer.d.ts +20 -0
  59. package/dist/topic-synthesizer.d.ts.map +1 -1
  60. package/dist/topic-synthesizer.js +113 -3
  61. package/dist/trigger-registry.d.ts.map +1 -1
  62. package/dist/trigger-registry.js +10 -2
  63. package/dist/types.d.ts +271 -1
  64. package/dist/types.d.ts.map +1 -1
  65. package/dist/version.d.ts +7 -7
  66. package/dist/version.d.ts.map +1 -1
  67. package/dist/version.js +17 -7
  68. package/docs/DIAGNOSTICS.md +205 -0
  69. package/docs/INTEGRATION_VALIDATION.md +186 -0
  70. package/docs/MIGRATION.md +9 -6
  71. package/docs/MIGRATION_GUIDE.md +125 -101
  72. package/docs/ROADMAP.md +238 -20
  73. package/docs/TUNING.md +19 -5
  74. package/install.sh +152 -401
  75. package/memory-plugin/LICENSE +190 -0
  76. package/memory-plugin/README.md +20 -0
  77. package/memory-plugin/dist/index.js +50 -0
  78. package/memory-plugin/package.json +2 -2
  79. package/package.json +18 -4
  80. package/plugin/LICENSE +190 -0
  81. package/plugin/README.md +20 -0
  82. package/plugin/dist/index.d.ts +29 -0
  83. package/plugin/dist/index.d.ts.map +1 -1
  84. package/plugin/dist/index.js +288 -23
  85. package/plugin/dist/index.js.map +1 -1
  86. package/plugin/package.json +2 -2
  87. package/scripts/install-runtime.mjs +12 -1
@@ -0,0 +1,205 @@
1
+ # HyperMem Diagnostics
2
+
3
+ HyperMem diagnostics are split into operator CLIs, validation scripts, and runtime logs. Use this page to decide which surface proves which part of the system.
4
+
5
+ ## Diagnostic surfaces
6
+
7
+ | Surface | Command | Proves |
8
+ |---|---|---|
9
+ | Health summary | `hypermem-status --health` | data dir, SQLite health, basic runtime state |
10
+ | Operator dashboard | `hypermem-status --master` | concise fleet-facing status summary |
11
+ | JSON status | `hypermem-status --json` | machine-readable database and runtime state |
12
+ | Model audit | `hypermem-model-audit --strict` | active models have known context-window behavior or overrides |
13
+ | Memory benchmark | `hypermem-bench --iterations 1000 --warmup 50 --agent <agent>` | local dataset access latency with p50/p95/p99 timings |
14
+ | Compose report | `node scripts/compose-report.mjs` | direct compositor slot selection, budget decisions, diagnostics fields |
15
+ | Trim report | `node scripts/trim-report.mjs` | trim events, cache invalidation, pressure behavior |
16
+ | Version parity | `npm run validate:version-parity` | package versions and plugin dependencies are release-aligned |
17
+ | Release path | `npm run validate:release-path` | build plus plugin pipeline gateway path |
18
+ | Docs/config validation | `npm run validate:docs && npm run validate:config` | documented commands and config surfaces match code |
19
+
20
+ ## `hypermem-status`
21
+
22
+ Primary uses:
23
+
24
+ - confirm data directory exists
25
+ - confirm SQLite databases are readable
26
+ - confirm vectors and message stores are not obviously corrupt
27
+ - distinguish healthy-empty installs from broken installs
28
+
29
+ Examples:
30
+
31
+ ```bash
32
+ hypermem-status --health
33
+ hypermem-status --master
34
+ hypermem-status --agent forge --master
35
+ hypermem-status --json
36
+ ```
37
+
38
+ Healthy fresh install behavior may include empty counts or `no sessions ingested`. That is not a failure. A fresh install becomes active only after the gateway loads the plugins and an agent turn runs.
39
+
40
+ Failure signals:
41
+
42
+ | Signal | Meaning | Next check |
43
+ |---|---|---|
44
+ | missing data dir | HyperMem has not initialized or `HYPERMEM_DATA_DIR` points elsewhere | verify plugin load and gateway logs |
45
+ | SQLite open failure | permissions, corruption, or incompatible data dir | check filesystem owner and run SQLite integrity check |
46
+ | vector dimension mismatch | embedding provider changed without rebuild or migration | inspect provider/model/dimension config |
47
+ | stale index time | background indexing not running or no new data | check gateway logs for embed/index messages |
48
+
49
+ ## `hypermem-model-audit`
50
+
51
+ Model audit checks whether HyperMem can size the context budget for active models.
52
+
53
+ ```bash
54
+ hypermem-model-audit
55
+ hypermem-model-audit --strict
56
+ hypermem-model-audit --models openai-codex/gpt-5.4,ollama/llama-3.3-70b
57
+ ```
58
+
59
+ Use strict mode in release validation. A strict failure means the model should get an explicit `contextWindowOverrides` entry before treating pressure diagnostics as authoritative.
60
+
61
+ ## Memory access benchmark
62
+
63
+ `hypermem-bench` measures storage access speed against the operator's local HyperMem dataset, normally `~/.openclaw/hypermem`.
64
+
65
+ ```bash
66
+ hypermem-bench --iterations 1000 --warmup 50 --agent main
67
+ hypermem-bench --iterations 1000 --warmup 50 --data-dir /path/to/hypermem
68
+ ```
69
+
70
+ It reports min, average, p50, p95, p99, and max latency for the data paths present in that install, including message hot-path lookups, session/conversation lookup, message FTS, facts, episodes, topics, fleet records, and doc chunks.
71
+
72
+ Use this for local validation of README speed claims. Results depend on hardware, database size, selected agent, and which optional surfaces are enabled. Vector embedding generation and hosted reranker latency are not part of these SQLite access timings; they are configured separately and should be measured against the chosen provider.
73
+
74
+ ## Runtime logs
75
+
76
+ After wiring and restart:
77
+
78
+ ```bash
79
+ openclaw logs --limit 100 | grep -E 'hypermem|context-engine|falling back'
80
+ ```
81
+
82
+ Healthy startup and compose lines include:
83
+
84
+ ```text
85
+ [hypermem] hypermem initialized
86
+ [hypermem] Embedding provider: none - semantic search disabled, using FTS5 fallback
87
+ [hypermem:compose]
88
+ ```
89
+
90
+ Hard failure lines include:
91
+
92
+ ```text
93
+ falling back to default engine "legacy"
94
+ Cannot find module 'zod'
95
+ Cannot find module 'sqlite-vec'
96
+ ```
97
+
98
+ If OpenClaw falls back to `legacy`, HyperMem is not composing prompts. Treat that as install failure, not degraded success.
99
+
100
+ ## Compose diagnostics
101
+
102
+ Compose diagnostics prove that the compositor is selecting, budgeting, and exposing runtime fields.
103
+
104
+ Key fields to inspect:
105
+
106
+ | Field family | What it proves |
107
+ |---|---|
108
+ | token budget fields | model-aware context window sizing and reserve math |
109
+ | `sessionPressureFraction` and `pressureSource` | unified pressure signal is present |
110
+ | history depth fields | pre-compose history depth estimation is active |
111
+ | prompt placement fields | query-shaped tail and slot placement behavior |
112
+ | adaptive lifecycle fields | lifecycle band and breadcrumb decisions are visible |
113
+ | warm restore fields | snapshot restore, repair, parity, and rollout gates are visible |
114
+ | tool/artifact fields | tool chain preservation and oversize degradation are working |
115
+
116
+ Direct check:
117
+
118
+ ```bash
119
+ node scripts/compose-report.mjs
120
+ ```
121
+
122
+ Release gate coverage:
123
+
124
+ ```bash
125
+ node test/unified-pressure-signal.mjs
126
+ node test/history-depth-estimator.mjs
127
+ node test/sprint4-prompt-placement.mjs
128
+ node test/adaptive-lifecycle.mjs
129
+ node --test test/composition-snapshot-integrity.test.mjs
130
+ node --test test/composition-snapshot-store.test.mjs
131
+ ```
132
+
133
+ ## Warm restore diagnostics
134
+
135
+ Warm restore validation must prove 4 things:
136
+
137
+ 1. snapshots are written with integrity metadata
138
+ 2. restored snapshots preserve required system repair notices
139
+ 3. repaired snapshots are capped and cannot become restore sources
140
+ 4. rollout gates fall back to cold rewarm when parity or provider checks fail
141
+
142
+ Release gate coverage:
143
+
144
+ ```bash
145
+ node --test test/composition-snapshot-integrity.test.mjs
146
+ node --test test/composition-snapshot-store.test.mjs
147
+ node test/repair-tool-pairs.mjs
148
+ ```
149
+
150
+ ## Adaptive lifecycle diagnostics
151
+
152
+ 0.9.0 ships the adaptive lifecycle behavior set: shared pressure-band policy, adaptive recall breadth, adaptive eviction ordering, lifecycle telemetry, and metadata-only topic-signal reporting.
153
+
154
+ Validate:
155
+
156
+ ```bash
157
+ node test/adaptive-lifecycle.mjs
158
+ node test/unified-pressure-signal.mjs
159
+ ```
160
+
161
+ Expected proof:
162
+
163
+ - lifecycle band is computed
164
+ - compose diagnostics expose lifecycle fields
165
+ - telemetry JSONL includes `lifecycle-policy` events for `compose.preRecall` and `compose.eviction`
166
+ - `node scripts/trim-report.mjs <telemetry.jsonl>` reports lifecycle policy counts, band counts, and divergence turns
167
+ - `trim-report.mjs` and `compose-report.mjs` classify compose topic signal with metadata-only fields:
168
+ - `present`
169
+ - `absent-no-active-topic`
170
+ - `absent-stamping-incomplete`
171
+ - `intentionally-suppressed`
172
+ - `unknown`
173
+ - topic-signal reports use booleans, enums, counts, percentages, and reason codes only; they must not emit topic names, prompt text, document text, or user content
174
+ - afterTurn gradient cap limits pressure spikes
175
+ - threshold tuning remains deferred unless a populated telemetry baseline shows a specific threshold or behavior defect
176
+
177
+ Topic-signal interpretation:
178
+
179
+ - `present` means an active topic was resolved and stamped history was available.
180
+ - `absent-no-active-topic` means compose had no active topic source to use.
181
+ - `absent-stamping-incomplete` means an active topic existed but stamped inputs were missing or insufficient.
182
+ - `intentionally-suppressed` means schema or privacy policy intentionally omitted topic telemetry.
183
+
184
+ This report path closes the ambiguity from a baseline with no usable assemble topic fields. The 0.9.0 release gate is covered by deterministic metadata-only topic evidence; safe live topic-bearing compose samples remain future tuning evidence before topic-aware threshold changes.
185
+
186
+ ## Runtime diagnostics API allowlist
187
+
188
+ Verified 2026-04-24 against the installed OpenClaw runtime: `openclaw doctor --non-interactive` no longer reports the bundled public-surface allowlist blocker, and the memory-core runtime facade can load `memory-core/runtime-api.js`.
189
+
190
+ This is an upstream OpenClaw diagnostics surface, not HyperMem-owned runtime behavior. If the blocker returns, do not patch OpenClaw from this repo. Record the exact failing public-surface path and classify it as `upstream-required` unless the failing surface is HyperMem's own memory plugin diagnostics.
191
+
192
+ ## Release diagnostics checklist
193
+
194
+ Run this checklist before tagging:
195
+
196
+ ```bash
197
+ npm run validate:version-parity
198
+ npm run validate:docs
199
+ npm run validate:config
200
+ npm run validate:release-path
201
+ npm test
202
+ hypermem-model-audit --strict || true
203
+ ```
204
+
205
+ The local repo may not be the active OpenClaw runtime, so `hypermem-status` and `hypermem-model-audit` should be interpreted against the configured deployment. For package release proof, the required gates are version parity, docs/config validation, release path, tests, and pack dry runs.
@@ -0,0 +1,186 @@
1
+ # HyperMem Integration Validation
2
+
3
+ This page is the operator validation contract for HyperMem releases. It describes how the runtime pieces fit together and how to prove each one works before publishing or upgrading a deployment.
4
+
5
+ ## Runtime pieces
6
+
7
+ | Piece | Package or path | Purpose | Verification |
8
+ |---|---|---|---|
9
+ | Core library | `@psiclawops/hypermem` | SQLite stores, compositor primitives, retrieval, lifecycle policy, diagnostics helpers | `node -e "import('@psiclawops/hypermem')"` from an installed package |
10
+ | Context engine plugin | `~/.openclaw/plugins/hypermem/plugin` | OpenClaw `contextEngine` slot, prompt composition, warming, trimming, adaptive lifecycle diagnostics | `openclaw plugins list` shows `hypercompositor` loaded |
11
+ | Memory plugin | `~/.openclaw/plugins/hypermem/memory-plugin` | OpenClaw memory slot integration for `memory_search` and retrieval surfaces | `openclaw plugins list` shows `hypermem` loaded |
12
+ | Runtime staging tool | `hypermem-install` | Copies package runtime into `~/.openclaw/plugins/hypermem` | staged directory contains `dist`, `plugin`, `memory-plugin`, `bin` |
13
+ | Status CLI | `hypermem-status` | Health, database, vector, and runtime summary | `hypermem-status --health` exits cleanly or reports only healthy-empty state |
14
+ | Model audit CLI | `hypermem-model-audit` | Checks model context-window detection and overrides | `hypermem-model-audit --strict` reports no risky unknown models, or known required overrides |
15
+
16
+ ## Install state machine
17
+
18
+ Do not treat installation as complete until all 5 states pass.
19
+
20
+ | State | Meaning | Required proof |
21
+ |---|---|---|
22
+ | 1. Package installed | npm package is available | `npm install @psiclawops/hypermem` succeeds |
23
+ | 2. Runtime staged | package payload is copied into OpenClaw plugin runtime dir | `ls ~/.openclaw/plugins/hypermem` shows `dist`, `plugin`, `memory-plugin`, `bin` |
24
+ | 3. OpenClaw wired | OpenClaw config points at staged plugins | `plugins.load.paths` includes both staged plugin dirs, slots are set |
25
+ | 4. Runtime loaded | Gateway has loaded both plugins | `openclaw plugins list` shows `hypercompositor` and `hypermem` loaded |
26
+ | 5. Runtime active | HyperMem is composing live turns | logs show `[hypermem] hypermem initialized` and `[hypermem:compose]` |
27
+
28
+ A successful `hypermem-install` proves only state 2. It does not modify OpenClaw config and does not restart the gateway.
29
+
30
+ ## Fresh install validation
31
+
32
+ Run from a clean shell with OpenClaw already onboarded.
33
+
34
+ ```bash
35
+ node --version # v22+
36
+ openclaw gateway status # running or ready
37
+ openclaw config get gateway # returns config, not an onboarding error
38
+ npm install @psiclawops/hypermem
39
+ npx hypermem-install
40
+ ```
41
+
42
+ Create the lightweight starter config before the first restart:
43
+
44
+ ```bash
45
+ mkdir -p ~/.openclaw/hypermem
46
+ cat > ~/.openclaw/hypermem/config.json <<'JSON'
47
+ {
48
+ "embedding": { "provider": "none" },
49
+ "compositor": {
50
+ "budgetFraction": 0.55,
51
+ "contextWindowReserve": 0.25,
52
+ "targetBudgetFraction": 0.50,
53
+ "warmHistoryBudgetFraction": 0.27,
54
+ "maxFacts": 25,
55
+ "maxHistoryMessages": 500,
56
+ "maxCrossSessionContext": 4000,
57
+ "maxRecentToolPairs": 3,
58
+ "maxProseToolPairs": 10,
59
+ "keystoneHistoryFraction": 0.15,
60
+ "keystoneMaxMessages": 12,
61
+ "wikiTokenCap": 500
62
+ }
63
+ }
64
+ JSON
65
+ ```
66
+
67
+ Wire OpenClaw using merge-safe config changes:
68
+
69
+ ```bash
70
+ openclaw config get plugins.load.paths
71
+ openclaw config get plugins.allow
72
+
73
+ HYPERMEM_PATHS="["${HOME}/.openclaw/plugins/hypermem/plugin","${HOME}/.openclaw/plugins/hypermem/memory-plugin"]"
74
+ openclaw config set plugins.load.paths "$HYPERMEM_PATHS" --strict-json
75
+ openclaw config set plugins.slots.contextEngine hypercompositor
76
+ openclaw config set plugins.slots.memory hypermem
77
+
78
+ # Only if plugins.allow already contains an array, append the two ids to that existing array.
79
+ # Do not create a new allowlist just for HyperMem.
80
+ openclaw config set plugins.allow '["existing-plugin","hypercompositor","hypermem"]' --strict-json
81
+
82
+ openclaw gateway restart
83
+ ```
84
+
85
+ Verify activation:
86
+
87
+ ```bash
88
+ openclaw plugins list
89
+ openclaw logs --limit 100 | grep -E 'hypermem|context-engine'
90
+ hypermem-status --health
91
+ hypermem-model-audit --strict
92
+ ```
93
+
94
+ Expected lightweight signals:
95
+
96
+ ```text
97
+ [hypermem] hypermem initialized
98
+ [hypermem] Embedding provider: none - semantic search disabled, using FTS5 fallback
99
+ [hypermem:compose]
100
+ ```
101
+
102
+ ## Upgrade validation
103
+
104
+ An upgrade must preserve data and config.
105
+
106
+ ```bash
107
+ cp -a ~/.openclaw/plugins/hypermem ~/.openclaw/plugins/hypermem.backup.$(date +%Y%m%d-%H%M%S) 2>/dev/null || true
108
+ npm install @psiclawops/hypermem@latest
109
+ npx hypermem-install
110
+ openclaw gateway restart
111
+ ```
112
+
113
+ Validate after restart:
114
+
115
+ ```bash
116
+ openclaw plugins list
117
+ openclaw logs --limit 100 | grep -E 'hypermem|context-engine|falling back'
118
+ hypermem-status --health
119
+ hypermem-model-audit --strict
120
+ ```
121
+
122
+ Pass criteria:
123
+
124
+ - existing `~/.openclaw/hypermem/config.json` is unchanged unless the operator edits it intentionally
125
+ - existing `~/.openclaw/hypermem/agents/*/messages.db` files remain present
126
+ - `openclaw plugins list` shows both plugins loaded
127
+ - logs do not show `falling back to default engine "legacy"`
128
+ - health output is clean, or reports only healthy-empty state on unused installs
129
+
130
+ Rollback:
131
+
132
+ ```bash
133
+ openclaw config set plugins.slots.contextEngine legacy
134
+ openclaw config set plugins.slots.memory none
135
+ openclaw gateway restart
136
+ ```
137
+
138
+ Data under `~/.openclaw/hypermem` is not removed by rollback.
139
+
140
+ ## Release package validation
141
+
142
+ Before publishing a release, run:
143
+
144
+ ```bash
145
+ npm run validate:version-parity
146
+ npm run validate:docs
147
+ npm run validate:config
148
+ npm run validate:release-path
149
+ npm test
150
+ npm --prefix plugin run build
151
+ npm --prefix memory-plugin run build
152
+ npm pack --dry-run
153
+ npm pack ./plugin --dry-run
154
+ npm pack ./memory-plugin --dry-run
155
+ ```
156
+
157
+ Then test the packed artifact from a temp directory:
158
+
159
+ ```bash
160
+ TMP=$(mktemp -d)
161
+ npm --prefix "$TMP" init -y
162
+ npm --prefix "$TMP" install ./psiclawops-hypermem-*.tgz
163
+ node "$TMP/node_modules/@psiclawops/hypermem/scripts/install-runtime.mjs" "$TMP/runtime"
164
+ find "$TMP/runtime" -maxdepth 3 -type f | sort
165
+ ```
166
+
167
+ The staged runtime must contain:
168
+
169
+ - `dist/`
170
+ - `plugin/dist/`
171
+ - `memory-plugin/dist/`
172
+ - `bin/hypermem-status.mjs`
173
+ - `bin/hypermem-model-audit.mjs`
174
+ - `node_modules/sqlite-vec` plus native sqlite-vec packages when present
175
+ - `node_modules/zod`
176
+
177
+ ## Integration failure signatures
178
+
179
+ | Symptom | Likely cause | Fix |
180
+ |---|---|---|
181
+ | `falling back to default engine "legacy"` | Plugin not loaded, wrong slot, stale runtime, or allowlist collision | verify load paths, slots, allowlist merge, and staged `dist` files |
182
+ | `Cannot find module 'zod'` | runtime staging missed plugin dependency | rerun `hypermem-install`, verify `node_modules/zod` staged |
183
+ | sqlite-vec native load error | native sqlite-vec package missing from staged runtime | rerun staging from a package with sqlite-vec native payload included |
184
+ | `memory_search` bypasses HyperMem | memory slot not set or memory plugin not loaded | set `plugins.slots.memory hypermem`, restart, verify plugins list |
185
+ | status tool reports missing data dir | gateway has not initialized HyperMem yet | restart after wiring and send one agent message |
186
+ | model audit flags unknown context window | active model needs explicit override | add `contextWindowOverrides` in HyperMem config |
package/docs/MIGRATION.md CHANGED
@@ -11,9 +11,9 @@ All migration examples default to **dry-run** where shown. Add `--apply` only wh
11
11
 
12
12
  ## Multi-operator deployments (breaking change warning)
13
13
 
14
- > ⚠️ **KL-01: No global-scope write gate (still open as of 0.8.0)**
14
+ > ⚠️ **KL-01: No global-scope write gate (still open as of 0.9.0)**
15
15
  >
16
- > hypermem 0.5.0 ships without a write gate for `scope='global'` facts. In a
16
+ > hypermem 0.9.0 ships without a write gate for `scope='global'` facts. In a
17
17
  > **single-operator deployment** (one user, one fleet sharing `library.db`), this
18
18
  > is acceptable — agents share context intentionally.
19
19
  >
@@ -21,7 +21,7 @@ All migration examples default to **dry-run** where shown. Add `--apply` only wh
21
21
  > `library.db`), this is a **breaking isolation risk**: a global-scope write from
22
22
  > one operator's agent propagates to all other operators' agents.
23
23
  >
24
- > **Do not run hypermem 0.5.0 in a multi-operator deployment without an external
24
+ > **Do not run hypermem in a multi-operator deployment without an external
25
25
  > write gate at the application layer.** The write gate is deferred to 1.0.0
26
26
  > where it will be enforced at the library DB level.
27
27
  >
@@ -37,6 +37,7 @@ Older versions below 0.5.0 used Redis, so the table keeps that history explicit.
37
37
 
38
38
  | hypermem version | Main DB schema | Library DB schema | Min Node | External cache |
39
39
  |---|---|---|---|---|
40
+ | 0.9.0 | v11 | v19 | 22.0.0 | none, SQLite `:memory:` hot cache |
40
41
  | 0.8.0 | v10 | v19 | 22.0.0 | none, SQLite `:memory:` hot cache |
41
42
  | 0.7.0 | v7 | v13 | 22.0.0 | none, SQLite `:memory:` hot cache |
42
43
  | 0.6.0 | v6 | v12 | 22.0.0 | none, SQLite `:memory:` hot cache |
@@ -46,11 +47,13 @@ Older versions below 0.5.0 used Redis, so the table keeps that history explicit.
46
47
  Schema versions are importable for programmatic checks:
47
48
  ```ts
48
49
  import { SCHEMA_COMPAT, HYPERMEM_COMPAT_VERSION } from 'hypermem';
49
- // HYPERMEM_COMPAT_VERSION = '0.8.0'
50
- // SCHEMA_COMPAT = { compatVersion: '0.8.0', mainSchema: 10, librarySchema: 19 }
50
+ // HYPERMEM_COMPAT_VERSION = ENGINE_VERSION, for example '0.9.0'
51
+ // SCHEMA_COMPAT = { compatVersion: ENGINE_VERSION, mainSchema: 11, librarySchema: 19 }
51
52
  ```
52
53
 
53
54
  If your DBs are behind, run:
54
55
  ```bash
55
- node scripts/migrate-legacy-sessions.mjs --apply
56
+ # Current releases migrate schemas on open. Back up the data dir first.
57
+ cp -a ~/.openclaw/hypermem ~/.openclaw/hypermem.pre-upgrade.$(date +%Y%m%d-%H%M%S)
58
+ openclaw gateway restart
56
59
  ```