openclaw/scripts/lib
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
..
ts-topology
arg-utils.mjs refactor: dedupe tooling helpers 2026-04-23 18:09:20 +01:00
bundled-extension-manifest.ts
bundled-plugin-build-entries-types.d.ts
bundled-plugin-build-entries.d.mts
bundled-plugin-build-entries.d.ts
bundled-plugin-build-entries.mjs
bundled-plugin-paths.mjs
bundled-plugin-root-runtime-mirrors.mjs build: fix bundled plugin runtime mirror guard 2026-04-23 04:15:39 +01:00
bundled-plugin-source-utils.mjs
bundled-runtime-sidecar-paths.json feat(tokenjuice): bundle the native adapter (#69946) 2026-04-21 23:58:37 -07:00
callsite-guard.mjs
changed-extensions.mjs
channel-contract-test-plan.mjs ci: reduce node runner fanout 2026-04-23 15:25:28 +01:00
check-timing-summary.mjs
ci-node-test-plan.mjs ci: move tail node shards to blacksmith 2026-04-24 18:03:29 +01:00
copy-assets.ts
dependency-ownership.json refactor(pdf): move document extraction to plugin 2026-04-24 17:15:05 -07:00
docker-e2e-image.sh ci: reuse docker e2e image across matrix 2026-04-23 06:02:51 +01:00
docker-e2e-logs.sh test(docker): make e2e temp logs portable 2026-04-23 16:56:44 +01:00
error-format.mjs
extension-import-boundary-checker.mjs feat: Add /models add hot-reload model registration (#70211) 2026-04-22 12:00:30 -05:00
extension-package-boundary.ts
extension-source-classifier.d.mts
extension-source-classifier.mjs
extension-test-plan.mjs ci: rebalance browser extension shard 2026-04-23 05:16:54 +01:00
format-generated-module.mjs
generated-output-utils.mjs
guard-inventory-utils.mjs
import-cycle-graph.ts refactor: dedupe tooling helpers 2026-04-23 18:09:20 +01:00
ios-version.ts
live-docker-auth.sh test: parallelize docker aggregate 2026-04-23 14:31:18 +01:00
live-docker-stage.sh fix: restore reliable live Docker staging 2026-04-24 20:10:28 +01:00
local-heavy-check-runtime.mjs build: update tsgo native preview 2026-04-23 15:59:49 +01:00
managed-child-process.mjs fix(scripts): reap child check processes 2026-04-23 08:44:58 -07:00
mintlify-accordion.mjs fix: prevent malformed docs accordions 2026-04-24 18:42:07 +01:00
npm-pack-budget.d.mts
npm-pack-budget.mjs
npm-publish-plan.mjs
official-external-channel-catalog.json fix(plugins): pin official external channel source (#70997) 2026-04-24 00:35:03 -07:00
optional-bundled-clusters-types.d.ts
optional-bundled-clusters.d.mts
optional-bundled-clusters.d.ts
optional-bundled-clusters.mjs
package-root-args.mjs
pairing-guard-context.mjs
plugin-clawhub-release.ts
plugin-npm-release.ts
plugin-sdk-doc-metadata.ts refactor: share provider selection runtime helper 2026-04-24 01:50:43 +01:00
plugin-sdk-entries.d.mts
plugin-sdk-entries.mjs
plugin-sdk-entrypoints.json fix: enforce memory search session visibility (#70761) (thanks @nefainl) 2026-04-25 09:30:21 +05:30
plugin-sdk-private-local-only-subpaths.json
record-shared.mjs
run-extension-oxlint.mjs Bridge Codex native hooks into OpenClaw 2026-04-24 16:48:26 +01:00
source-file-scan-cache.mjs
test-group-report.mjs
ts-guard-utils.mjs
tsgo-sparse-guard.mjs refactor: dedupe tooling helpers 2026-04-23 18:09:20 +01:00
vitest-batch-runner.mjs
vitest-local-scheduling.d.mts
vitest-local-scheduling.mjs fix(test): throttle local vitest under memory pressure 2026-04-23 12:56:28 -07:00
vitest-report-cli-utils.mjs
workspace-bootstrap-smoke.mjs