@lotargo/memory_plugin 1.5.3 → 1.6.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/CHANGELOG.md ADDED
@@ -0,0 +1,108 @@
1
+ # Changelog
2
+
3
+ All notable changes to `@lotargo/memory_plugin` are documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [1.6.0] - 2026-08-10
9
+
10
+ This release is the outcome of a full five-part audit (publishing, security, code
11
+ quality, tests, documentation): 92 checklist items across 8 stages. It also fixes
12
+ a critical retrieval regression introduced after `v1.5.3`.
13
+
14
+ ### Breaking
15
+
16
+ - **Node.js 22.5.0 or newer is now required.** The engine is built on the built-in
17
+ `node:sqlite` module, which only exists from Node 22.5.0. Previously `engines`
18
+ was absent and the README claimed `>=18.0.0`, so installs on Node 18/20/21 failed
19
+ at runtime with `ERR_UNKNOWN_BUILTIN_MODULE` instead of at install time.
20
+ - **`ingest_document({ type: "file" })` no longer reads arbitrary paths.** Reads are
21
+ restricted to the current working directory and the plugin data directory. Widen
22
+ the allowlist with `ingestAllowedPaths`, or set `ingestAllowAnyPath: true` to
23
+ restore the old behaviour.
24
+
25
+ ### Fixed
26
+
27
+ - **Vector search returned zero results (critical).** A `Buffer.isBuffer()` guard
28
+ added after `v1.5.3` discarded every stored vector, because `node:sqlite` returns
29
+ BLOB columns as `Uint8Array`, not `Buffer`. Vector and hybrid retrieval silently
30
+ degraded to BM25-only. The same bug pushed **empty** vectors to the cloud in
31
+ `hybrid-sync` and wrote empty vectors into exported snapshots.
32
+ - `update_fact` in the OpenCode plugin never parsed `**Title** body`: its regex was
33
+ double-escaped. The title was stored verbatim as part of the body.
34
+ - `SQLITE_BUSY` ("database is locked") under concurrency — `PRAGMA busy_timeout`
35
+ is now set to 5000 ms (it defaulted to 0).
36
+ - Switching storage mode leaked the previous SQLite handle and Turso client; the
37
+ old connection is now closed before it is replaced.
38
+ - A database-init failure no longer blocks reopening the **local** database: the
39
+ retry cooldown applies to cloud modes only.
40
+ - `runWithRetry` leaked an `abort` listener on every attempt.
41
+ - Optional numeric tool arguments (`offset`, `limit`, `startLine`, `endLine`,
42
+ `dimension`) rejected empty strings with "Expected number"; they are now coerced.
43
+ - `link`, `unlink`, `relink`, `identity`, `migrate_titles`, `enable-prompt` and
44
+ `disable-prompt` were unreachable through the `memory_plugin` binary — the process
45
+ started an MCP server and blocked on stdin instead of running the command.
46
+ - GPU trace reports were written to stdout, which is the MCP JSON-RPC channel.
47
+
48
+ ### Security
49
+
50
+ - Secrets are encrypted with PBKDF2 raised from 10,000 to **600,000** iterations
51
+ (OWASP guidance); existing files are transparently re-encrypted on first read.
52
+ - `auth_secrets.enc` is written with owner-only permissions (`0600`).
53
+ - The machine fingerprint no longer includes the volatile hostname and username,
54
+ which could permanently lock a user out of their own secrets after a rename.
55
+ - SSRF filtering rewritten: IPv6 literals are unwrapped from their brackets,
56
+ IPv4-mapped forms (`::ffff:127.0.0.1`, `::ffff:7f00:1`), link-local, unique-local,
57
+ multicast and CGNAT ranges are blocked, and the resolved address is re-checked
58
+ before the request to defend against DNS rebinding — on the initial request and
59
+ on every redirect hop.
60
+ - Cloud tokens are no longer taken from `argv` by default: environment variables
61
+ are preferred, then a hidden stdin prompt. Passing a token as a flag now warns.
62
+ - Snapshot paths are resolved with `realpath`, so a symlink or junction can no
63
+ longer escape the allowlisted directories.
64
+ - Snapshot and blob decompression is capped at 512 MB to prevent zip bombs.
65
+
66
+ ### Added
67
+
68
+ - `CHANGELOG.md` (this file).
69
+ - `--help` and `--version` for both `memory_plugin` and `memory-cli`.
70
+ - Config keys `ingestAllowedPaths` and `ingestAllowAnyPath`.
71
+ - `mcp-server/logger.js`: a central logger with levels (`MEMORY_LOG_LEVEL`), an
72
+ stderr sink and a swappable transport.
73
+ - Two regression test suites — vector BLOB round-trip and benchmark report
74
+ labelling. The suite is now 12 files, all green.
75
+
76
+ ### Changed
77
+
78
+ - The six Notebook tools live in a single implementation
79
+ (`mcp-server/tools/core/memory_core.js`) shared by the MCP server and the
80
+ OpenCode plugin. They previously carried separate copies, so fixes reached only
81
+ one surface. `opencode-plugin/index.js` shrank from 1161 to 825 lines and
82
+ `memory_tools.js` from 516 to 124.
83
+ - The OpenCode plugin uses static ESM imports instead of top-level
84
+ `await import(...)`, and registers its `exit` hook once per instance rather than
85
+ on every module import.
86
+ - Importing `run_benchmarks.js` no longer launches a full benchmark run; the report
87
+ renderer is exported as the pure function `buildMarkdownReport()`.
88
+ - `npm audit`: 5 advisories (1 moderate, 4 high) down to 3. The remaining
89
+ unfixable ones (`xlsx`, `sharp` via `@huggingface/transformers`) are documented
90
+ in the README with their reachability.
91
+ - Removed the stale nested `mcp-server/package.json`, a version-drift source.
92
+
93
+ ### Documentation
94
+
95
+ - Corrected claims that did not match the code: the "DPAPI / OS Secret Store"
96
+ credential storage, the circuit breaker failing over to a "local database cache",
97
+ a non-existent GitHub mirror for model weights, the tool count, the TUI
98
+ diagnostics menu, and the GraphRAG language coverage.
99
+ - Documented the `MEMORY_DIR` → `OPENCODE_CONFIG_DIR` → legacy `~/.config` →
100
+ `%LOCALAPPDATA%` resolution order, the previously undocumented config keys, and
101
+ the `update_fact` `title` parameter.
102
+ - Benchmark reports labelled the headline RRF/RSF rows with the grid-search winner
103
+ (`k=10`) while the numbers were computed with the runtime default (`k=60`). The
104
+ generator and every published table now state the parameters actually used.
105
+ - `BENCHMARKS.md` tables were re-derived from the stored JSON artifacts; the
106
+ bge-m3 section had carried e5-small numbers shifted by a column.
107
+
108
+ [1.6.0]: https://github.com/Lotargo/memory_pugin/releases/tag/v1.6.0