claude-mem-lite 2.53.1 → 2.54.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/hook-llm.mjs
CHANGED
|
@@ -677,9 +677,13 @@ search_aliases: 2-6 alternative search terms someone might use to find this memo
|
|
|
677
677
|
files: episode.files,
|
|
678
678
|
filesRead: episode.filesRead || [],
|
|
679
679
|
// v2.33.1: when lesson is low-signal, don't trust Haiku's importance
|
|
680
|
-
// inflation
|
|
681
|
-
//
|
|
682
|
-
|
|
680
|
+
// inflation. v2.54.0: extended from {change, discovery} to all types
|
|
681
|
+
// except `decision` after audit (2026-04-30) showed bugfix lesson
|
|
682
|
+
// coverage 11.2% / refactor hit-rate 18.1% — Haiku marks bugfix/refactor
|
|
683
|
+
// imp=2-3 even when lesson is null after retry. Keep `decision` exempt:
|
|
684
|
+
// it's rare (39 obs / 94.9% hit-rate) and the retry path already gave
|
|
685
|
+
// it a second chance; a no-lesson decision is still a worthwhile signal.
|
|
686
|
+
importance: isLessonLowSignal && parsed.type !== 'decision'
|
|
683
687
|
? Math.min(ruleImportance, 1)
|
|
684
688
|
: Math.max(ruleImportance, clampImportance(parsed.importance)),
|
|
685
689
|
lessonLearned,
|
package/hook-optimize.mjs
CHANGED
|
@@ -709,7 +709,14 @@ export async function handleLLMOptimize() {
|
|
|
709
709
|
}
|
|
710
710
|
|
|
711
711
|
try {
|
|
712
|
-
|
|
712
|
+
// v2.54.0: auto-maintain default scope is 'wide'. Narrow scope (the prior
|
|
713
|
+
// default) only matches fully-degraded rows (no concepts AND no facts AND
|
|
714
|
+
// no lesson AND no aliases) — production diagnostic 2026-04-30 found only
|
|
715
|
+
// 56 obs ever optimized after months of daily auto-maintain runs. Wide
|
|
716
|
+
// targets bugfix/refactor/feature/decision rows with substantive narrative
|
|
717
|
+
// but missing lesson_learned, which is exactly the audit's 11.2% coverage
|
|
718
|
+
// gap. CLI `mem optimize` keeps narrow as default for explicit invocations.
|
|
719
|
+
const results = await optimizeRun(db, { reenrichScope: 'wide' });
|
|
713
720
|
const parts = [];
|
|
714
721
|
if (results.reenrich?.processed) parts.push(`re-enriched: ${results.reenrich.processed}`);
|
|
715
722
|
if (results.normalize?.processed) parts.push(`normalized: ${results.normalize.processed}`);
|
|
@@ -155,19 +155,26 @@ export function isNoiseObservation(obs, env = process.env) {
|
|
|
155
155
|
const lesson = obs.lessonLearned ?? obs.lesson_learned;
|
|
156
156
|
if (lesson && String(lesson).trim() && String(lesson).trim().toLowerCase() !== 'none') return false;
|
|
157
157
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
if (
|
|
161
|
-
obs.facts.filter(f => typeof f === 'string' && f.trim().length > 0).length >= 1) {
|
|
162
|
-
return false;
|
|
163
|
-
}
|
|
158
|
+
const hasFacts = Array.isArray(obs.facts) &&
|
|
159
|
+
obs.facts.filter(f => typeof f === 'string' && f.trim().length > 0).length >= 1;
|
|
160
|
+
if (hasFacts) return false;
|
|
164
161
|
|
|
165
162
|
const narrative = (obs.narrative || '').trim();
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
163
|
+
const isPassthrough = _isLikelyToolOutputPassthrough(narrative);
|
|
164
|
+
const isStderrShape = /^Error[: ]/i.test(narrative);
|
|
165
|
+
|
|
166
|
+
// v2.54.0: raw tool-output passthrough is always noise regardless of importance.
|
|
167
|
+
// Rule-based importance (computeRuleImportance) can hit 2-3 from filename
|
|
168
|
+
// heuristics (test/schema/migration) even when narrative is just
|
|
169
|
+
// "cmd → ERROR: stderr" — 30d audit found 64 'Error: X' titles surviving via
|
|
170
|
+
// imp=2 escape with raw stderr narratives. Per #8152 paired-gate model: this
|
|
171
|
+
// is the drop counterpart to capNoiseImportance's demote — both must check
|
|
172
|
+
// the same passthrough signal.
|
|
173
|
+
if (isPassthrough || isStderrShape) return true;
|
|
174
|
+
|
|
175
|
+
if ((obs.importance ?? 1) >= 2) return false;
|
|
176
|
+
|
|
177
|
+
if (narrative.length >= 40) return false;
|
|
171
178
|
|
|
172
179
|
return true;
|
|
173
180
|
}
|
package/package.json
CHANGED
|
@@ -34,6 +34,12 @@ export function detectMissingImports(installRoot) {
|
|
|
34
34
|
return ['server.mjs'];
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
// Strip line + block comments so example strings in docblocks (e.g. the very
|
|
38
|
+
// patterns this regex enumerates) can't false-fire as "missing files".
|
|
39
|
+
src = src
|
|
40
|
+
.replace(/\/\*[\s\S]*?\*\//g, '')
|
|
41
|
+
.replace(/(^|\s)\/\/[^\n]*/g, '$1');
|
|
42
|
+
|
|
37
43
|
const missing = new Set();
|
|
38
44
|
for (const re of [FROM_RE, IMPORT_RE]) {
|
|
39
45
|
re.lastIndex = 0;
|
package/scripts/launch.mjs
CHANGED
|
@@ -12,12 +12,22 @@ const ROOT = process.env.CLAUDE_PLUGIN_ROOT || join(__dirname, '..');
|
|
|
12
12
|
|
|
13
13
|
if (!existsSync(join(ROOT, 'node_modules', 'better-sqlite3'))) {
|
|
14
14
|
process.stderr.write('[claude-mem-lite] Installing dependencies...\n');
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
try {
|
|
16
|
+
execSync('npm install --omit=dev', {
|
|
17
|
+
cwd: ROOT,
|
|
18
|
+
stdio: ['ignore', 'pipe', 'inherit'], // stdout piped (discard), stderr inherit
|
|
19
|
+
timeout: 120_000,
|
|
20
|
+
});
|
|
21
|
+
process.stderr.write('[claude-mem-lite] Dependencies installed\n');
|
|
22
|
+
} catch (e) {
|
|
23
|
+
// Plugin-cache / multi-user / disk-full installs can fail here. Without this
|
|
24
|
+
// catch the user sees a Node stack trace; with it they get an actionable line.
|
|
25
|
+
const detail = e.message?.split('\n')[0] || e.code || 'unknown error';
|
|
26
|
+
process.stderr.write(`[claude-mem-lite] npm install failed in ${ROOT} — ${detail}\n`);
|
|
27
|
+
process.stderr.write(`[claude-mem-lite] Likely cause: read-only directory, disk full, or network blocked.\n`);
|
|
28
|
+
process.stderr.write(`[claude-mem-lite] Repair: cd "${ROOT}" && npm install --omit=dev\n`);
|
|
29
|
+
process.exit(1);
|
|
30
|
+
}
|
|
21
31
|
}
|
|
22
32
|
|
|
23
33
|
// Verify MCP SDK is importable (exports mapping intact).
|