claude-mem-lite 4.0.0 → 4.0.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-mem-lite",
3
- "version": "4.0.0",
3
+ "version": "4.0.2",
4
4
  "description": "Persistent long-term memory for Claude Code via MCP — captures coding decisions, bugfixes, and context across sessions. Hybrid FTS5 + TF-IDF search with episode batching. Single SQLite DB, no external services. A lighter, lower-cost alternative to claude-mem (episode batching + a smaller model; cost savings are an internal estimate, not a measured benchmark).",
5
5
  "type": "module",
6
6
  "packageManager": "npm@10.9.2",
@@ -217,13 +217,13 @@
217
217
  },
218
218
  "devDependencies": {
219
219
  "@eslint/js": "^10.0.1",
220
- "@vitest/coverage-v8": "^4.1.11",
220
+ "@vitest/coverage-v8": "^5.0.0",
221
221
  "acorn": "8.18.0",
222
222
  "eslint": "^10.9.1",
223
223
  "fast-check": "^4.9.0",
224
224
  "knip": "^6.34.0",
225
225
  "picomatch": "^4.0.4",
226
226
  "prettier": "3.9.6",
227
- "vitest": "^4.0.18"
227
+ "vitest": "^5.0.0"
228
228
  }
229
229
  }
@@ -132,6 +132,14 @@ try {
132
132
  probe: () => first,
133
133
  exec: (cmd, opts) => execSync(cmd, { ...opts, timeout: 20000 }),
134
134
  verify: () => helpers.probeBindingInFreshProcess(ROOT, { timeoutMs: 8000 }),
135
+ // NOT on this path (A20260906-R8b-P0-1). The source build is
136
+ // `node-gyp clean && node-gyp rebuild`: it deletes build/ before compiling, and a full
137
+ // compile takes ~41 s against the 20 s cap above — so under this budget it does not fail
138
+ // harmlessly, it destroys a binding that was working (measured: DB opens YES → NO, .node
139
+ // gone, SIGTERM at 20.02 s), and repeats every SessionStart because setup.sh writes its
140
+ // marker only on success. The compile belongs on a foreground path with no cap:
141
+ // `claude-mem-lite rebuild-binding`, which is what the repair hints now print.
142
+ sourceBuild: false,
135
143
  });
136
144
  } finally {
137
145
  // process.exit skips finally blocks — every exit below this point, so the
@@ -93,9 +93,15 @@ const NB_BROKEN_MARKER = join(HOOK_RUNTIME_DIR, 'native-binding-broken');
93
93
  const NB_HEAL_MARKER = join(HOOK_RUNTIME_DIR, 'native-binding-lastheal');
94
94
  // Literal, not imported: the pure-`node:` charter above forbids importing lib/
95
95
  // here (this file must survive a broken install). Kept in sync with
96
- // lib/binding-probe.mjs::NATIVE_BINDING_REBUILD_CMD, which is the single home
97
- // everywhere the charter allows an import.
98
- const NB_MANUAL_CMD = 'npm rebuild better-sqlite3 --dangerously-allow-all-scripts';
96
+ // lib/binding-probe.mjs::nativeBindingRepairHint, which is the single home
97
+ // everywhere the charter allows an import — and pinned to it by
98
+ // tests/audit-r8-binding-repair-hint.test.mjs, because a literal kept in sync by
99
+ // a comment is a literal that drifts (A20260906-R8-P1-1).
100
+ //
101
+ // BOTH commands, `&&` not `||`: `npm rebuild` exits 0 without compiling on
102
+ // better-sqlite3 13, so it can neither heal nor signal failure on its own.
103
+ const NB_MANUAL_CMD =
104
+ 'npm rebuild better-sqlite3 --dangerously-allow-all-scripts && npm run --prefix node_modules/better-sqlite3 build-release';
99
105
 
100
106
  // Resolvable invocation of the bundled CLI's repair path. Absolute via
101
107
  // INSTALL_DIR (import.meta.url) so it works on a plugin-only install, where
@@ -69,7 +69,8 @@ if (!existsSync(join(ROOT, 'node_modules', 'better-sqlite3'))) {
69
69
  // intact but the .node binary stale → server FATALs with "Could not locate
70
70
  // the bindings file" on first DB open. Probe + auto-rebuild before launching.
71
71
  try {
72
- const { ensureBetterSqlite3Working, probeBindingInFreshProcess } = await import('../lib/binding-probe.mjs');
72
+ const { ensureBetterSqlite3Working, probeBindingInFreshProcess, nativeBindingRepairHint } =
73
+ await import('../lib/binding-probe.mjs');
73
74
  // The rebuild inside ensureBetterSqlite3Working mutates node_modules — the
74
75
  // same write class as install/repair/update, and this was the ONE rebuild
75
76
  // path outside the shared install.lock: a second MCP launch or a concurrent
@@ -106,9 +107,7 @@ try {
106
107
  }
107
108
  if (!verify.ok) {
108
109
  process.stderr.write(`[claude-mem-lite] better-sqlite3 binding unusable: ${verify.error}\n`);
109
- process.stderr.write(
110
- `[claude-mem-lite] Repair: cd "${ROOT}" && npm rebuild better-sqlite3 --dangerously-allow-all-scripts\n`,
111
- );
110
+ process.stderr.write(`[claude-mem-lite] Repair: ${nativeBindingRepairHint(ROOT)}\n`);
112
111
  process.exit(1);
113
112
  }
114
113
  if (verify.action === 'rebuilt') {
package/scripts/setup.sh CHANGED
@@ -187,7 +187,10 @@ if [[ -d "$ROOT/node_modules/better-sqlite3" ]]; then
187
187
  mark_deps_ok
188
188
  else
189
189
  log_warn "better-sqlite3 native binding unusable — hooks degraded until repaired (flag: $DEPS_FLAG)"
190
- mark_deps_broken "better-sqlite3 binding probe/rebuild failed (npm >= 12 blocks compile scripts by default)" "npm rebuild better-sqlite3 --dangerously-allow-all-scripts"
190
+ # Both commands, `&&` not `||`: `npm rebuild` exits 0 without compiling on
191
+ # better-sqlite3 13 (no install script to run), so it never signals failure and
192
+ # an `||` chain would never reach the source build. A20260906-R8-P1-1.
193
+ mark_deps_broken "better-sqlite3 binding probe/rebuild failed (npm >= 12 blocks compile scripts by default)" "npm rebuild better-sqlite3 --dangerously-allow-all-scripts && npm run --prefix node_modules/better-sqlite3 build-release"
191
194
  fi
192
195
  fi
193
196