rag-memory-epf-mcp 3.6.0 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/docs/UPDATING.md CHANGED
@@ -119,3 +119,60 @@ All other tools are additive (`embedding_status`, `endpoint_embedding_status`,
119
119
  stats `server` block). Error responses now set `isError: true`; embedding-gate
120
120
  errors are structured: `{code: "MODEL_NOT_READY" | "EMBEDDINGS_DISABLED",
121
121
  state, retry_after_ms?, message}`.
122
+
123
+ ## v4.0: migrating to schema v13 (observation lifecycle)
124
+
125
+ ### One process per database while migrating
126
+
127
+ The migration runs during `initialize()`, before `server.connect()`, so within a
128
+ single server there is no writer to race. **Two servers opened on the same database
129
+ file at once are not supported**, and the migration window is where that matters:
130
+ a commit landing between the backup and the migration is included in the migration
131
+ but not in the recovery point, so restoring would lose it. This is not enforced by
132
+ a lock — the deployment model is one server per project (`DB_FILE_PATH` per
133
+ project's `.mcp.json`), and the rollout below preserves that. If you have arranged
134
+ something else, stop the other process before upgrading.
135
+
136
+ ### Recovery points
137
+
138
+ Before applying anything, the server writes a snapshot next to the database:
139
+ `<db>.v<current>.bak`. It uses the SQLite Online Backup API, not `VACUUM INTO`,
140
+ because VACUUM may renumber the ROWIDs of tables without an explicit
141
+ `INTEGER PRIMARY KEY` — `entities` is such a table and `entities_fts` indexes it by
142
+ ROWID, so a renumbered snapshot would pass `quick_check` and still fail FTS queries
143
+ once restored. Every snapshot is verified before it is published: page-level
144
+ `quick_check`, plus FTS5's own `integrity-check` on each full-text index.
145
+
146
+ **An existing snapshot is never overwritten.** A second attempt writes `.bak.1`, a
147
+ third `.bak.2`. Every file in that rotation was taken before any schema change, so
148
+ each one is a valid pre-migration snapshot on its own — nothing has to prove which
149
+ one matches the live database.
150
+
151
+ To restore: stop the server, move the live database aside, copy the snapshot into
152
+ its place, and start again. The engine will re-apply the migration.
153
+
154
+ ### Recovery-point slots are full
155
+
156
+ If all three slots are taken, the server refuses to migrate and exits before it
157
+ connects. **In an MCP client this looks like the server being unavailable**, and the
158
+ explanation is only on stderr — check the client's MCP log for a line beginning
159
+ `migration refused:`.
160
+
161
+ The slot count is a circuit breaker for one schema version, not a disk quota (each
162
+ version has its own set), and the files in it are not necessarily failed attempts —
163
+ an unrelated or stale `.bak` occupies a slot just the same. Look at what is there,
164
+ move aside what you do not need, and start the server again. Nothing is deleted for
165
+ you: a recovery point is never removed automatically.
166
+
167
+ ### Rollout
168
+
169
+ Canary one project, then three of different sizes, then the rest. At each step,
170
+ confirm after the first boot:
171
+
172
+ - the MCP log shows `backup <path>` followed by `Migration 13 applied successfully`
173
+ - `getMigrationStatus` reports version 13
174
+ - a search still returns results (`searchNodes` on a term you know exists)
175
+ - `getObservationHistory({entity_name: "<some entity>"})` returns its roots
176
+
177
+ Then kill the server mid-run and restart it once, to confirm a restart resumes
178
+ rather than refusing.
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "rag-memory-epf-mcp",
3
- "version": "3.6.0",
3
+ "version": "4.0.0",
4
4
  "engines": {
5
5
  "node": ">=24"
6
6
  },
7
- "description": "Project-local RAG memory MCP server — knowledge graph + multilingual vector + FTS5 in a single SQLite file. Per-project isolation, 30 MCP tools, codepoint-safe chunking (Korean/CJK/emoji).",
7
+ "description": "Project-local RAG memory MCP server — knowledge graph + multilingual vector + FTS5 in a single SQLite file. Per-project isolation, 38 MCP tools, codepoint-safe chunking (Korean/CJK/emoji).",
8
8
  "keywords": [
9
9
  "mcp",
10
10
  "model-context-protocol",
@@ -45,7 +45,7 @@
45
45
  "prepare": "npm run build",
46
46
  "watch": "tsc --watch",
47
47
  "verify:invariants": "node test/chunk-invariants.test.mjs",
48
- "verify:engine": "node test/engine-smoke.test.mjs && node test/launch-smoke.test.mjs && node test/sync-atomicity.test.mjs && node test/dedup.test.mjs && node test/search-degradation.test.mjs && node test/entity-embed-cap.test.mjs && node test/migration12.test.mjs && node test/model-cache.test.mjs && node test/embedding-gate.test.mjs && node test/lazy-boot.test.mjs && node test/reconciliation.test.mjs && node test/backfill.test.mjs && node test/fts-query.test.mjs && node test/search-contracts.test.mjs && node test/tool-contracts.test.mjs && node test/bounded-exit.test.mjs",
48
+ "verify:engine": "node test/engine-smoke.test.mjs && node test/launch-smoke.test.mjs && node test/sync-atomicity.test.mjs && node test/dedup.test.mjs && node test/search-degradation.test.mjs && node test/entity-embed-cap.test.mjs && node test/migration12.test.mjs && node test/model-cache.test.mjs && node test/embedding-gate.test.mjs && node test/lazy-boot.test.mjs && node test/reconciliation.test.mjs && node test/backfill.test.mjs && node test/fts-query.test.mjs && node test/search-contracts.test.mjs && node test/tool-contracts.test.mjs && node test/bounded-exit.test.mjs && node test/observation-schema.test.mjs && node test/observation-migration.test.mjs && node test/observation-lifecycle.test.mjs && node test/observation-contracts.test.mjs && node test/observation-search.test.mjs && node test/observation-cascade.test.mjs && node test/observation-realdata.test.mjs",
49
49
  "test": "npm run build && npm run verify:invariants && npm run verify:engine",
50
50
  "prepublishOnly": "npm run build && npm run verify:invariants && npm run verify:engine"
51
51
  },