Skip to content

fix(core): enforce scope visibility in memory retrieval#1031

Merged
kunickiaj merged 1 commit into
mainfrom
05-04-fix_core_enforce_scope_visibility_in_memory_retrieval
May 5, 2026
Merged

fix(core): enforce scope visibility in memory retrieval#1031
kunickiaj merged 1 commit into
mainfrom
05-04-fix_core_enforce_scope_visibility_in_memory_retrieval

Conversation

@kunickiaj
Copy link
Copy Markdown
Owner

@kunickiaj kunickiaj commented May 5, 2026

Description

Adds a central scope-visibility gate so default MemoryStore and search paths cannot return memories outside the device's authorized sharing domains. Local-default and legacy null/blank scope rows remain visible; coordinator-scope rows require an active local membership. Explicit scope filters (scope_id, include_scope_ids, exclude_scope_ids) intersect with the gate, never widen it.

This is the foundation for the OV4G.5 retrieval-hardening stack (codemem-ov4g.5.2).

Type of Change

  • 🐛 Bug fix (fixes an issue)

Testing

  • Relevant checks pass locally (`pnpm run tsc`, `pnpm run lint`, `pnpm run test`)
  • Added/updated tests for changes
  • Manually verified changes work as expected

Coverage: store get/recent/recentByKinds/search/timeline/explain, plus a regression for legacy null/blank scope rows.

Checklist

  • Code follows project style (`pnpm run lint` passes for touched files)
  • Self-review completed
  • Documentation updated (if needed)
  • No new warnings introduced

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4d95120c9b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/core/src/filters.ts Outdated
@kunickiaj kunickiaj force-pushed the 05-04-fix_core_enforce_scope_visibility_in_memory_retrieval branch from 4d95120 to 6d49107 Compare May 5, 2026 14:36
Copy link
Copy Markdown
Owner Author

kunickiaj commented May 5, 2026

Merge activity

  • May 5, 2:59 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • May 5, 2:59 PM UTC: Graphite rebased this pull request as part of a merge.
  • May 5, 3:01 PM UTC: @kunickiaj merged this pull request with Graphite.

Apply local scope authorization centrally across core store/search read paths so caller-provided scope filters can only narrow visible data. This prevents unauthorized scope rows from leaking through direct reads, ranking, timeline windows, or explain diagnostics.
@kunickiaj kunickiaj force-pushed the 05-04-fix_core_enforce_scope_visibility_in_memory_retrieval branch from 6d49107 to 9b34cd1 Compare May 5, 2026 14:59
@kunickiaj kunickiaj merged commit da8bbfd into main May 5, 2026
8 checks passed
@kunickiaj kunickiaj deleted the 05-04-fix_core_enforce_scope_visibility_in_memory_retrieval branch May 5, 2026 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant