claude-mem-lite 2.49.0 → 2.49.1
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
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
jaccardSimilarity, truncate, clampImportance, computeRuleImportance,
|
|
8
8
|
inferProject, parseJsonFromLLM,
|
|
9
9
|
computeMinHash, estimateJaccardFromMinHash, cjkBigrams, EDIT_TOOLS, LOW_SIGNAL_TITLE, debugCatch, debugLog, OBS_BM25,
|
|
10
|
-
getCurrentBranch,
|
|
10
|
+
getCurrentBranch, notLowSignalTitleClause,
|
|
11
11
|
} from './utils.mjs';
|
|
12
12
|
import { acquireLLMSlot, releaseLLMSlot } from './hook-semaphore.mjs';
|
|
13
13
|
import { getVocabulary, computeVector } from './tfidf.mjs';
|
|
@@ -802,10 +802,14 @@ export async function handleLLMSummary() {
|
|
|
802
802
|
const sessionId = process.argv[3] || getSessionId();
|
|
803
803
|
const project = process.argv[4] || inferProject();
|
|
804
804
|
|
|
805
|
+
// Exclude LOW_SIGNAL hook-llm fallback titles ("Error: files +2 more: ...",
|
|
806
|
+
// "Modified X", "Worked on X", etc.) from the Haiku summary input — they
|
|
807
|
+
// pollute the `completed` field and mislead session-resume context.
|
|
805
808
|
const recentObs = db.prepare(`
|
|
806
809
|
SELECT id, type, title, narrative
|
|
807
810
|
FROM observations
|
|
808
811
|
WHERE memory_session_id = ?
|
|
812
|
+
AND ${notLowSignalTitleClause('')}
|
|
809
813
|
ORDER BY created_at_epoch DESC
|
|
810
814
|
LIMIT 30
|
|
811
815
|
`).all(sessionId);
|
package/mem-cli.mjs
CHANGED
|
@@ -450,8 +450,13 @@ function searchFts(db, ftsQuery, { type, project, limit, dateFrom, dateTo, minIm
|
|
|
450
450
|
|
|
451
451
|
function cmdRecent(db, args) {
|
|
452
452
|
const { positional, flags } = parseArgs(args);
|
|
453
|
-
const
|
|
454
|
-
const
|
|
453
|
+
const rawArg = positional[0];
|
|
454
|
+
const rawLimit = parseInt(rawArg, 10);
|
|
455
|
+
const isValid = Number.isInteger(rawLimit) && rawLimit > 0;
|
|
456
|
+
if (rawArg !== undefined && !isValid) {
|
|
457
|
+
process.stderr.write(`[mem] Invalid count "${rawArg}" (must be a positive integer); using default 10\n`);
|
|
458
|
+
}
|
|
459
|
+
const limit = isValid ? rawLimit : 10;
|
|
455
460
|
const project = flags.project ? resolveProject(db, flags.project) : inferProject();
|
|
456
461
|
|
|
457
462
|
const params = [];
|
package/package.json
CHANGED
|
@@ -216,6 +216,9 @@ function searchByUserPrompts(db, queryText, project, limit) {
|
|
|
216
216
|
if (!ftsQuery) return [];
|
|
217
217
|
|
|
218
218
|
const cutoff = Date.now() - LOOKBACK_MS;
|
|
219
|
+
// Exclude <task-notification> internal protocol messages — parity with
|
|
220
|
+
// server.mjs mem_search + mem-cli.mjs search (see lesson #8139: read-path
|
|
221
|
+
// parity across paths querying the same table).
|
|
219
222
|
const sql = `
|
|
220
223
|
SELECT up.id, up.prompt_text, up.created_at_epoch,
|
|
221
224
|
bm25(user_prompts_fts) as relevance
|
|
@@ -225,6 +228,7 @@ function searchByUserPrompts(db, queryText, project, limit) {
|
|
|
225
228
|
WHERE user_prompts_fts MATCH ?
|
|
226
229
|
AND s.project = ?
|
|
227
230
|
AND up.created_at_epoch > ?
|
|
231
|
+
AND up.prompt_text NOT LIKE '<task-notification>%'
|
|
228
232
|
ORDER BY relevance
|
|
229
233
|
LIMIT ?
|
|
230
234
|
`;
|
package/tool-schemas.mjs
CHANGED
|
@@ -423,7 +423,7 @@ export const tools = [
|
|
|
423
423
|
' - After a major project phase completes and old per-file observations are noise\n' +
|
|
424
424
|
' - Stats show thousands of low-importance rows dragging search quality\n' +
|
|
425
425
|
'\n' +
|
|
426
|
-
'Equivalent CLI: claude-mem-lite compress [--
|
|
426
|
+
'Equivalent CLI: claude-mem-lite compress [--execute] [--age-days 90] (preview is default)',
|
|
427
427
|
inputSchema: memCompressSchema,
|
|
428
428
|
hidden: true,
|
|
429
429
|
},
|
|
@@ -442,7 +442,7 @@ export const tools = [
|
|
|
442
442
|
' - After bulk imports or a long offline period\n' +
|
|
443
443
|
' - User asks for periodic maintenance / cleanup\n' +
|
|
444
444
|
'\n' +
|
|
445
|
-
'Equivalent CLI: claude-mem-lite maintain
|
|
445
|
+
'Equivalent CLI: claude-mem-lite maintain scan --ops dedup,decay',
|
|
446
446
|
inputSchema: memMaintainSchema,
|
|
447
447
|
hidden: true,
|
|
448
448
|
},
|
|
@@ -461,7 +461,7 @@ export const tools = [
|
|
|
461
461
|
' - stats show many degraded (title-only, no lesson) observations\n' +
|
|
462
462
|
' - Start with action="preview" to see candidates before spending tokens\n' +
|
|
463
463
|
'\n' +
|
|
464
|
-
'Equivalent CLI: claude-mem-lite optimize [--
|
|
464
|
+
'Equivalent CLI: claude-mem-lite optimize [--run|--run-all] [--task re-enrich,normalize,cluster-merge,smart-compress] [--max N] (preview is default)',
|
|
465
465
|
inputSchema: memOptimizeSchema,
|
|
466
466
|
hidden: true,
|
|
467
467
|
},
|