openclaw/extensions/memory-core/src
Michiel van den Donker 2c716f5677
fix: enforce memory search session visibility (#70761) (thanks @nefainl)
* [EV-001] memory-core: filter memory_search session hits by visibility

- Move session visibility + listSpawnedSessionKeys to plugin-sdk; sync test
  hook with sessions-resolution __testing.setDepsForTest
- Extract loadCombinedSessionStoreForGateway to config/sessions; re-export
  from gateway session-utils
- Add session-transcript-hit stem resolver for builtin + QMD paths
- Post-filter memory_search results before citations/recall; fail closed when
  requester session key missing; optional corpus=sessions
- Tests: stem extraction, visibility filter smoke, existing suites green

* chore: sync plugin-sdk exports for session-transcript-hit and session-visibility

Run pnpm plugin-sdk:sync-exports so package.json exports match
scripts/lib/plugin-sdk-entrypoints.json. Fixes contract tests and
lint:plugins:plugin-sdk-subpaths-exported for memory-core imports.

* fix(EV-001): cross-agent session memory hits + hoist combined store load

- resolveTranscriptStemToSessionKeys: stop filtering by requester agentId so
  keys from other agents reach createSessionVisibilityGuard (a2a + visibility=all).
- Re-export loadCombinedSessionStoreForGateway from session-transcript-hit;
  filterMemorySearchHitsBySessionVisibility loads the combined store once per pass.
- Drop unused agentId from filter params; extend tests (Greptile/Codex review).

* fix(memory_search): honor corpus=sessions before maxResults cap

Pass sources into MemoryIndexManager.search so FTS/vector queries add
source IN (...) before ranking and top-N slice (Codex: non-session hits
could fill the window).

QMD path: oversample fetch limit for single-source recall, filter by
source, then diversify/clamp to the requested maxResults.

Wire corpus=sessions from tools; extend MemorySearchManager opts and
wrappers.

* fix(memory_search): apply corpus=memory source filter like sessions

Pass sources: ["memory"] into manager.search so maxResults applies only
within the memory index; post-filter for defense in depth. Document
corpus=memory in the tool description.

* fix: scope qmd session memory search

* fix: enforce memory search session visibility (#70761) (thanks @nefainl)

---------

Co-authored-by: NefAI <info@nefai.nl>
Co-authored-by: Ayaan Zaidi <hi@obviy.us>
2026-04-25 09:30:21 +05:30
..
memory fix: enforce memory search session visibility (#70761) (thanks @nefainl) 2026-04-25 09:30:21 +05:30
cli.host.runtime.ts
cli.runtime.ts memory/dreaming: decouple managed cron from heartbeat (#70737) 2026-04-23 22:23:19 -07:00
cli.test.ts memory/dreaming: decouple managed cron from heartbeat (#70737) 2026-04-23 22:23:19 -07:00
cli.ts Memory/dreaming: feed grounded backfill into short-term promotion (#63370) 2026-04-08 23:31:37 +02:00
cli.types.ts Memory/dreaming: feed grounded backfill into short-term promotion (#63370) 2026-04-08 23:31:37 +02:00
concept-vocabulary.test.ts memory/dreaming: decouple managed cron from heartbeat (#70737) 2026-04-23 22:23:19 -07:00
concept-vocabulary.ts memory/dreaming: decouple managed cron from heartbeat (#70737) 2026-04-23 22:23:19 -07:00
config.test.ts refactor: type config schemas as typebox-compatible 2026-04-23 05:22:16 +01:00
dreaming-command.test.ts memory/dreaming: decouple managed cron from heartbeat (#70737) 2026-04-23 22:23:19 -07:00
dreaming-command.ts memory/dreaming: decouple managed cron from heartbeat (#70737) 2026-04-23 22:23:19 -07:00
dreaming-markdown.test.ts test(memory-core): share workspace test helper 2026-04-06 05:21:45 +01:00
dreaming-markdown.ts feat(memory-wiki): restore llm wiki stack 2026-04-06 04:56:52 +01:00
dreaming-narrative.test.ts memory/dreaming: decouple managed cron from heartbeat (#70737) 2026-04-23 22:23:19 -07:00
dreaming-narrative.ts memory/dreaming: decouple managed cron from heartbeat (#70737) 2026-04-23 22:23:19 -07:00
dreaming-phases.test.ts memory/dreaming: decouple managed cron from heartbeat (#70737) 2026-04-23 22:23:19 -07:00
dreaming-phases.ts memory/dreaming: decouple managed cron from heartbeat (#70737) 2026-04-23 22:23:19 -07:00
dreaming-repair.test.ts Fix dreaming replay, repair polluted artifacts, and gate wiki tabs (#65138) 2026-04-12 00:25:11 -05:00
dreaming-repair.ts Fix dreaming replay, repair polluted artifacts, and gate wiki tabs (#65138) 2026-04-12 00:25:11 -05:00
dreaming-shared.test.ts memory/dreaming: decouple managed cron from heartbeat (#70737) 2026-04-23 22:23:19 -07:00
dreaming-shared.ts memory/dreaming: decouple managed cron from heartbeat (#70737) 2026-04-23 22:23:19 -07:00
dreaming.test.ts memory/dreaming: decouple managed cron from heartbeat (#70737) 2026-04-23 22:23:19 -07:00
dreaming.ts memory/dreaming: decouple managed cron from heartbeat (#70737) 2026-04-23 22:23:19 -07:00
flush-plan.ts fix(memory-core): preserve dated DREAMS trail 2026-04-05 23:35:44 +01:00
memory-events.test.ts test(memory-core): share workspace test helper 2026-04-06 05:21:45 +01:00
memory-tool-manager-mock.ts fix(context-window): Tighten context limits and bound memory excerpts (#67277) 2026-04-15 13:06:02 -05:00
prompt-section.ts fix: stabilize live qa scenario suite 2026-04-08 08:17:59 +01:00
public-artifacts.test.ts fix: keep root memory uppercase (#70621) 2026-04-23 16:10:36 +01:00
public-artifacts.ts fix: keep root memory uppercase (#70621) 2026-04-23 16:10:36 +01:00
rem-evidence.ts perf: avoid sort-for-single selection 2026-04-20 23:20:31 +01:00
runtime-provider.ts
session-search-visibility.test.ts fix: enforce memory search session visibility (#70761) (thanks @nefainl) 2026-04-25 09:30:21 +05:30
session-search-visibility.ts fix: enforce memory search session visibility (#70761) (thanks @nefainl) 2026-04-25 09:30:21 +05:30
short-term-promotion.test.ts memory: block dreaming self-ingestion (#66852) 2026-04-14 20:29:12 -04:00
short-term-promotion.ts memory: block dreaming self-ingestion (#66852) 2026-04-14 20:29:12 -04:00
test-helpers.ts fix(ci): clear check-additional follow-up regressions (#63934) 2026-04-09 23:47:59 +01:00
tools.citations.test.ts fix(context-window): Tighten context limits and bound memory excerpts (#67277) 2026-04-15 13:06:02 -05:00
tools.citations.ts refactor: dedupe memory lowercase helpers 2026-04-07 20:57:04 +01:00
tools.recall-tracking.test.ts test(memory-core): keep memory tool mock local to plugin 2026-04-10 08:05:56 +01:00
tools.runtime.ts
tools.shared.ts fix: enforce memory search session visibility (#70761) (thanks @nefainl) 2026-04-25 09:30:21 +05:30
tools.test-helpers.ts Add /trace toggle and fix Active Memory diagnostics 2026-04-12 13:20:22 -05:00
tools.test.ts feat: default active memory QMD recall to search (#65068) 2026-04-11 20:56:21 -05:00
tools.ts fix: enforce memory search session visibility (#70761) (thanks @nefainl) 2026-04-25 09:30:21 +05:30