claude-mem-lite 4.0.3 → 4.0.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.
@@ -10,7 +10,7 @@
10
10
  "plugins": [
11
11
  {
12
12
  "name": "claude-mem-lite",
13
- "version": "4.0.3",
13
+ "version": "4.0.4",
14
14
  "source": "./",
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)."
16
16
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-mem-lite",
3
- "version": "4.0.3",
3
+ "version": "4.0.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
@@ -60,11 +60,16 @@ function mdCell(s) {
60
60
 
61
61
  export function computeAdaptiveWindows(db, project) {
62
62
  const sevenDaysAgo = Date.now() - 7 * DAY_MS;
63
+ // liveObsFilterSql, not a hand-written half of it (A20260906-R8-§11.3). This COUNT is a
64
+ // POOL-SIZING input: the windows returned below are handed to the recall queries at :201 /
65
+ // :468 / :502, all three of which filter live rows. Counting a strictly larger population
66
+ // than the window is applied to inverts the documented intent — 80 superseded rows read as
67
+ // >10 obs/day and earned the TIGHTEST window (12h) for finding the few live rows left.
63
68
  const row = db
64
69
  .prepare(
65
70
  `
66
71
  SELECT COUNT(*) as c FROM observations
67
- WHERE project = ? AND created_at_epoch > ? AND COALESCE(compressed_into, 0) = 0
72
+ WHERE project = ? AND created_at_epoch > ? AND ${liveObsFilterSql('')}
68
73
  `,
69
74
  )
70
75
  .get(project, sevenDaysAgo);
package/hook-handoff.mjs CHANGED
@@ -136,6 +136,15 @@ export function buildAndSaveHandoff(db, sessionId, project, type, episodeSnapsho
136
136
  const obsWindowParams = ccWindowStart !== null ? [ccWindowStart] : [];
137
137
 
138
138
  // 2. Completed — from observations (include narrative for richer handoff)
139
+ //
140
+ // `compressed_into` ONLY, deliberately — not a half-written liveObsFilterSql. Audit
141
+ // 2026-08-14 F4 ruled on exactly this line: `completed` is the session's own history, and a
142
+ // decision a later save overturned still happened, so erasing it here would misreport the
143
+ // session. Only key_decisions (:242) is re-presented to a LATER session as standing policy,
144
+ // and that one does filter superseded_at. The scope guard is the third case of "F4 — handoff
145
+ // key_decisions excludes a retracted decision" in tests/audit-silent-20260814.test.mjs.
146
+ // Audit R8 §11.3 proposed adding the filter here from a repo-wide regex sweep of the
147
+ // predicate shape; it was rejected on this reasoning, and the guard catches it.
139
148
  const completed = db
140
149
  .prepare(
141
150
  `
@@ -41,6 +41,17 @@ export const FAST_SUMMARY_LIMITS = {
41
41
  /**
42
42
  * The two reads every fast summary is built from: the session's opening prompt, and the
43
43
  * titles of its most recent observations.
44
+ *
45
+ * The observation filter is `compressed_into` ONLY, deliberately — it is NOT a half-written
46
+ * `liveObsFilterSql` waiting to be completed. `completed` is the session's own history, and a
47
+ * lesson a later save overturned still happened; dropping it here would misreport the session
48
+ * that did the work. This is the same ruling audit 2026-08-14 F4 made for the sibling field
49
+ * `session_handoffs.completed`, where the scope guard lives in
50
+ * `tests/audit-silent-20260814.test.mjs`. Audit R8 §11.3 proposed adding `superseded_at IS
51
+ * NULL` to both; both were rejected on this reasoning. The filter that DOES belong on a
52
+ * superseded row is the one guarding standing policy re-presented to a later session
53
+ * (`key_decisions`), not history.
54
+ *
44
55
  * @returns {{request: string, completed: string}} raw (unscrubbed, untruncated) values
45
56
  */
46
57
  export function readFastSummarySource(db, sessionId) {
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "claude-mem-lite",
3
- "version": "4.0.3",
3
+ "version": "4.0.4",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "claude-mem-lite",
9
- "version": "4.0.3",
9
+ "version": "4.0.4",
10
10
  "dependencies": {
11
11
  "@modelcontextprotocol/sdk": "^1.30.0",
12
12
  "better-sqlite3": "^13.0.3",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-mem-lite",
3
- "version": "4.0.3",
3
+ "version": "4.0.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",