claude-mem-lite 6.13.3 → 6.13.4

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.
@@ -9,7 +9,7 @@
9
9
  "plugins": [
10
10
  {
11
11
  "name": "claude-mem-lite",
12
- "version": "6.13.3",
12
+ "version": "6.13.4",
13
13
  "source": "./",
14
14
  "homepage": "https://github.com/sdsrss/claude-mem-lite",
15
15
  "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)."
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-mem-lite",
3
- "version": "6.13.3",
3
+ "version": "6.13.4",
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
  "author": {
6
6
  "name": "sdsrss"
package/hook-context.mjs CHANGED
@@ -217,7 +217,7 @@ export function selectWithTokenBudget(db, project, budget = 2000) {
217
217
  OR (created_at_epoch > ? AND importance >= 2)
218
218
  OR (created_at_epoch > ? AND importance >= 3)
219
219
  )
220
- ORDER BY created_at_epoch DESC
220
+ ORDER BY created_at_epoch DESC, id DESC
221
221
  LIMIT ${KEYCTX_POOL_OBS}
222
222
  `,
223
223
  )
@@ -229,7 +229,7 @@ export function selectWithTokenBudget(db, project, budget = 2000) {
229
229
  SELECT id, request, completed, next_steps, created_at_epoch
230
230
  FROM session_summaries
231
231
  WHERE project = ? AND created_at_epoch > ?
232
- ORDER BY created_at_epoch DESC
232
+ ORDER BY created_at_epoch DESC, id DESC
233
233
  LIMIT ${KEYCTX_POOL_SESS}
234
234
  `,
235
235
  )
@@ -601,7 +601,7 @@ export function buildSessionContextLines(
601
601
  (created_at_epoch > ? AND importance >= 1)
602
602
  OR (created_at_epoch > ? AND importance >= 2)
603
603
  )
604
- ORDER BY created_at_epoch DESC
604
+ ORDER BY created_at_epoch DESC, id DESC
605
605
  LIMIT 5
606
606
  `,
607
607
  )
@@ -615,7 +615,7 @@ export function buildSessionContextLines(
615
615
  SELECT request, completed, next_steps, remaining_items, lessons, key_decisions, created_at
616
616
  FROM session_summaries
617
617
  WHERE project = ?
618
- ORDER BY created_at_epoch DESC
618
+ ORDER BY created_at_epoch DESC, id DESC
619
619
  LIMIT 1
620
620
  `,
621
621
  )
package/hook-llm.mjs CHANGED
@@ -1481,12 +1481,18 @@ ${obsList}`;
1481
1481
  ? JSON.stringify(llmParsed.key_decisions)
1482
1482
  : null;
1483
1483
 
1484
- // Upgrade existing fast summary instead of creating a duplicate
1484
+ // Upgrade existing fast summary instead of creating a duplicate. With two fast rows
1485
+ // for one session (Stop, then SessionStart's unguarded /clear or /compact path), the LOWEST id is
1486
+ // the Stop row, which carries the structural Done / Not done extract that the COALESCE
1487
+ // floor below preserves. Upgrading the highest id lost that content from Last Session
1488
+ // (v6.13.4 defect review P2-1), so the order is spelled out rather than left to the
1489
+ // index. No order covers every shape: the floor reads only the upgraded row (D#80).
1485
1490
  const existingFast = db
1486
1491
  .prepare(
1487
1492
  `
1488
1493
  SELECT id FROM session_summaries
1489
1494
  WHERE memory_session_id = ? AND notes = 'fast'
1495
+ ORDER BY id ASC
1490
1496
  LIMIT 1
1491
1497
  `,
1492
1498
  )
package/hook.mjs CHANGED
@@ -2145,7 +2145,7 @@ function saveHandoffAndFastSummary(
2145
2145
 
2146
2146
  // Build fast synchronous summary for immediate context availability.
2147
2147
  // Background llm-summary will produce a richer Haiku version later;
2148
- // context injection query (ORDER BY created_at_epoch DESC) auto-prefers latest.
2148
+ // context injection query (ORDER BY created_at_epoch DESC, id DESC) auto-prefers latest.
2149
2149
  try {
2150
2150
  const { request: fastRequestRaw, completed: fastCompletedRaw } = readFastSummarySource(
2151
2151
  db,
@@ -69,7 +69,7 @@ export function readFastSummarySource(db, sessionId) {
69
69
  `
70
70
  SELECT title FROM observations
71
71
  WHERE memory_session_id = ? AND COALESCE(compressed_into, 0) = 0
72
- ORDER BY created_at_epoch DESC LIMIT 5
72
+ ORDER BY created_at_epoch DESC, id DESC LIMIT 5
73
73
  `,
74
74
  )
75
75
  .all(sessionId);
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "claude-mem-lite",
3
- "version": "6.13.3",
3
+ "version": "6.13.4",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "claude-mem-lite",
9
- "version": "6.13.3",
9
+ "version": "6.13.4",
10
10
  "os": [
11
11
  "darwin",
12
12
  "linux",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-mem-lite",
3
- "version": "6.13.3",
3
+ "version": "6.13.4",
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",