@oh-my-pi/pi-mnemopi 18.4.0 → 18.4.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/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [18.4.1] - 2026-09-28
6
+
7
+ ### Fixed
8
+
9
+ - Fixed extracted facts still being recalled after their source memory was invalidated or expired. ([#12825](https://github.com/can1357/oh-my-pi/pull/12825) by [@Jpei1994](https://github.com/Jpei1994))
10
+
5
11
  ## [18.3.3] - 2026-09-27
6
12
 
7
13
  ### Fixed
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@oh-my-pi/pi-mnemopi",
4
- "version": "18.4.0",
4
+ "version": "18.4.2",
5
5
  "description": "Local SQLite memory engine for omp agents",
6
6
  "homepage": "https://omp.sh",
7
7
  "author": {
@@ -42,10 +42,10 @@
42
42
  "fmt": "oxfmt --no-error-on-unmatched-pattern 'src/**/*.{ts,tsx}' '{test,bench,examples,scripts}/**/*.ts' '*.ts'"
43
43
  },
44
44
  "dependencies": {
45
- "@oh-my-pi/pi-ai": "18.4.0",
46
- "@oh-my-pi/pi-catalog": "18.4.0",
47
- "@oh-my-pi/pi-natives": "18.4.0",
48
- "@oh-my-pi/pi-utils": "18.4.0"
45
+ "@oh-my-pi/pi-ai": "18.4.2",
46
+ "@oh-my-pi/pi-catalog": "18.4.2",
47
+ "@oh-my-pi/pi-natives": "18.4.2",
48
+ "@oh-my-pi/pi-utils": "18.4.2"
49
49
  },
50
50
  "peerDependencies": {
51
51
  "fastembed": "2.1.0",
@@ -404,10 +404,17 @@ function factsHaveScopeColumn(beam: BeamMemoryState): boolean {
404
404
 
405
405
  function factVisibilityWhere(beam: BeamMemoryState, tableAlias: string): { where: string; params: DbValue[] } {
406
406
  const prefix = tableAlias.length === 0 ? "" : `${tableAlias}.`;
407
- if (factsHaveScopeColumn(beam)) {
408
- return { where: `(${prefix}session_id = ? OR ${prefix}scope = 'global')`, params: [beam.sessionId] };
409
- }
410
- return { where: `${prefix}session_id = ?`, params: [beam.sessionId] };
407
+ const scope = factsHaveScopeColumn(beam)
408
+ ? `(${prefix}session_id = ? OR ${prefix}scope = 'global')`
409
+ : `${prefix}session_id = ?`;
410
+ // A fact is a derivative of the working_memory row it was extracted from: once that row is
411
+ // explicitly superseded (`memory_edit invalidate`) or has expired, the fact must stop
412
+ // surfacing — otherwise an explicit invalidation is silently defeated at the fact layer.
413
+ // Correlated EXISTS probes the source's primary key (same shape as the fts_working /
414
+ // fts_episodes visibility predicates). Facts whose source row no longer exists stay
415
+ // visible: nothing contradicts them.
416
+ const sourceSuperseded = `NOT EXISTS (SELECT 1 FROM working_memory w WHERE w.id = ${prefix}source_msg_id AND (w.superseded_by IS NOT NULL OR (w.valid_until IS NOT NULL AND w.valid_until <= ?)))`;
417
+ return { where: `${scope} AND ${sourceSuperseded}`, params: [beam.sessionId, nowIso()] };
411
418
  }
412
419
 
413
420
  function buildWhere(