---
id: 10951
title: Add team-private retrieval integration tests for Memory Core
state: CLOSED
labels:
  - enhancement
  - ai
  - testing
  - architecture
assignees:
  - neo-gpt
createdAt: '2026-05-08T10:48:18Z'
updatedAt: '2026-05-12T02:09:40Z'
githubUrl: 'https://github.com/neomjs/neo/issues/10951'
author: neo-gpt
commentsCount: 0
parentIssue: 10945
subIssues: []
subIssuesCompleted: 0
subIssuesTotal: 0
blockedBy: []
blocking: []
closedAt: '2026-05-09T20:59:26Z'
---
# Add team-private retrieval integration tests for Memory Core

## Context

Parent epic #10945 needs actionable deployment-pipeline coverage for multi-user Memory Core. The current integration suite proves basic alice/bob Chroma isolation, but not the team/private retrieval policy surface that #10010/#10011 track.

Duplicate sweep before filing:
- `gh issue list --search "team private retrieval Memory Core Native Edge Graph"` found adjacent epics #10016/#10691/#9999 and #10945, but no focused integration child.
- KB ticket search for the full multi-user deployment integration framing returned no conceptual duplicate.
- This ticket is the deployed-shape proof linked to the policy tickets, not a replacement for them.

## The Problem

A multi-user Memory Core deployment needs more than per-user isolation. Team/private retrieval semantics must be proven through real MCP requests across the same deployed stack agents will use. Otherwise Chroma metadata filtering, session summary retrieval, and Native Edge Graph tenant isolation can drift separately.

## The Architectural Reality

Relevant surfaces:
- #10010 — team vs private context retrieval flag.
- #10011 — Native Edge Graph tenant isolation semantics.
- #10016 — Multi-Tenant Identity & Data Privacy.
- Current integration fixture and `mcpClient.mjs` identity helpers.
- Memory Core tools: raw memory queries, session memory/session summary reads, and graph/topology query paths.

## The Fix

Add integration tests that seed memories and graph records under at least two users and one shared/team context, then verify retrieval behavior through real MCP calls.

The first pass should cover the smallest meaningful matrix:
- private memory is visible only to its owner;
- team/shared memory is visible to authorized team context;
- unrelated user cannot read private/team data;
- legacy/no-user data behavior is explicit and tested or deferred.

## Contract Ledger Matrix

| Target Surface | Source of Authority | Proposed Behavior | Fallback | Docs | Evidence |
|---|---|---|---|---|---|
| Raw memory retrieval | #10010, #10016 | Honors private/team visibility under deployed MCP calls | If team context is not implemented, test private isolation and mark team part blocked | MultiTenant/SharedDeployment docs if touched | Integration query matrix with owner/team/unrelated users |
| Session summaries | #10010, #10945 | Retrieval respects same identity policy as raw memory | If summaries remain disabled in fixture, document dependency on #10948/#10813 | MemoryCore docs if touched | Summary read assertions or explicit blocked dependency |
| Native Edge Graph | #10011, #10016 | Graph query paths apply tenant/team constraints | If graph RLS is not available, file precise substrate follow-up | Graph/privacy docs | Integration graph query assertions |

## Acceptance Criteria

- [ ] Integration fixture can seed at least owner/private and unrelated-user Memory Core records.
- [ ] Private retrieval is denied for unrelated user through real MCP calls.
- [ ] Team/shared retrieval behavior is tested or explicitly blocked by a named missing substrate.
- [ ] Native Edge Graph retrieval semantics are covered or explicitly linked to #10011 as a blocker.
- [ ] Legacy/no-user data behavior is documented in the test or Related section.
- [ ] PR body includes deliberate cross-tenant regression proof.

## Out of Scope

- Replacing #10010/#10011 policy work.
- Designing a full organization/team administration UI.
- Weakening default privacy semantics to make tests easier.

## Related

Parent: #10945
Adjacent: #10010, #10011, #10016, #10691, #9999

Origin Session ID: c02fbf4e-870c-44c0-ba7e-e9ffacce094b

Retrieval Hint: `query_raw_memories(query="team private retrieval Memory Core integration Native Edge Graph tenant isolation")`

## Timeline

- 2026-05-08T10:48:19Z @neo-gpt added the `enhancement` label
- 2026-05-08T10:48:19Z @neo-gpt added the `ai` label
- 2026-05-08T10:48:20Z @neo-gpt added the `testing` label
- 2026-05-08T10:48:20Z @neo-gpt added the `architecture` label
- 2026-05-08T10:48:26Z @neo-gpt added parent issue #10945
- 2026-05-08T10:49:13Z @neo-gpt cross-referenced by #10945
- 2026-05-08T12:02:32Z @neo-gpt cross-referenced by PR #10958
- 2026-05-08T12:05:25Z @neo-opus-ada referenced in commit `2015153` - "docs(agentos): incorporate Cycle 1 GPT review fixes + KB delta-update task (#10957)

@neo-gpt's PR #10958 Cycle 1 review at commentId IC_kwDODSospM8AAAABBqH6pg
flagged two blocking points; both addressed in this commit. Plus operator
added KB delta-update as another orchestrator-scoped task.

GPT RA1 — close-target / AC consistency:
- AC7 (ROADMAP.md cross-link) was deferred in original PR body; now satisfied
  inline in this commit. ROADMAP.md gains a new "v13 Architectural Path"
  section above "Current Focus: v12.2" linking to learn/agentos/v13-path.md
  and naming #9999 as the v13 main epic.
- AC8 native parent_child link was already done via update_issue_relationship
  immediately post-create (#9999 → #10957). Per-sub-issue follow-up comments
  remain post-merge work per ticket §"Out of Scope".

GPT RA2 — §6 audit completeness:
- Added #10945 row (open child of #9999, GPT's M1 lane; 5 valid sub-tickets
  #10947/#10949/#10950/#10951/#10952 with #10948 closed invalid post-correction)
- Added #10957 row (this very doc; meta — closes when this PR merges)

Operator addition (chief-architect input 2026-05-08):
- D3 Orchestrator scope expanded with Knowledge Base delta-update sync
  task. KB already supports delta updates via `npm run ai:sync-kb`;
  orchestrator schedules them on configurable cadence per the same
  per-host singleton pattern.

Co-Authored-By: tobiu <tobiasuhlig78@gmail.com>"
- 2026-05-08T12:18:01Z @tobiu referenced in commit `a77adf0` - "docs(agentos): v13 architectural path strategy document (#10957) (#10958)

* docs(agentos): add v13 architectural path strategy document (#10957)

Resolves #10957.

Authored 2026-05-08 per @tobiu's chief-architect mandate after today's
architectural-hallucination corrections (Factory-pattern partial-rollout
misread + NEO_MC_PRIMARY scoping over-correction).

Document covers the path from current substrate state (post-Bucket-G,
post-Factory-pattern, post-NEO_MC_PRIMARY-correction) to v13 release:

1. Vision — slim MCP servers + mature SDK + clean daemon architecture
2. Current State — empirically verified table comparing today vs target
3. Critical Architectural Decisions — D1 Factory eval (challenge-framed)
   / D2 common base server class / D3 orchestrator daemon architecture
   / D4 SDK migration boundary / D5 NEO_MC_PRIMARY retirement path
4. Sequenced Milestones M1-M7 — current week (M1 substrate stabilization
   with owner-split: Gemini unit-row, GPT integration, Claude doc) →
   v13 release cut
5. Tickets to file/update enumerated for each milestone
6. #9999 sub-issue audit — every open sub-issue triaged with
   on-trajectory / re-scope / verify markers
7. Risks + mitigations
8. Outcome metrics — quantitative v13 readiness targets
9. Provenance — citation chain back to today's correction

Strategic shape (~280 lines), not exhaustive specification. Per-milestone
prescriptions live in their own tickets/PRs; this doc is the chief-architect
anchor for swarm coordination across that work.

Co-Authored-By: tobiu <tobiasuhlig78@gmail.com>

* docs(agentos): incorporate Gemini's PR #10958 review depth-floor adds (#10957)

Cycle 1 review approved at commentId IC_kwDODSospM8AAAABBqGSkg with two
non-blocking considerations for M2/M3 implementation phases. Folding both
into the strategic doc rather than deferring to implementation memory:

D1 (AsyncLocalStorage edge cases) — explicit mention of:
- EventEmitter boundaries (handlers fire in emitter's own context)
- SSE streaming async generators (iterators yielding async to event loop
  can lose context across yield points)

D2 (Common Base Server Class) — added "Extension points the base must
expose" subsection enumerating registerTools / registerServices /
registerMiddleware / registerHealthChecks. The middleware/interceptor
pipeline (custom AuthMiddleware variants, parameter-validation
interceptors, per-server request hooks) was the specific concern Gemini
flagged — currently duplicated across the 2/5 servers that wrap dispatch;
base class makes it pluggable.

Co-Authored-By: tobiu <tobiasuhlig78@gmail.com>

* docs(agentos): incorporate Cycle 1 GPT review fixes + KB delta-update task (#10957)

@neo-gpt's PR #10958 Cycle 1 review at commentId IC_kwDODSospM8AAAABBqH6pg
flagged two blocking points; both addressed in this commit. Plus operator
added KB delta-update as another orchestrator-scoped task.

GPT RA1 — close-target / AC consistency:
- AC7 (ROADMAP.md cross-link) was deferred in original PR body; now satisfied
  inline in this commit. ROADMAP.md gains a new "v13 Architectural Path"
  section above "Current Focus: v12.2" linking to learn/agentos/v13-path.md
  and naming #9999 as the v13 main epic.
- AC8 native parent_child link was already done via update_issue_relationship
  immediately post-create (#9999 → #10957). Per-sub-issue follow-up comments
  remain post-merge work per ticket §"Out of Scope".

GPT RA2 — §6 audit completeness:
- Added #10945 row (open child of #9999, GPT's M1 lane; 5 valid sub-tickets
  #10947/#10949/#10950/#10951/#10952 with #10948 closed invalid post-correction)
- Added #10957 row (this very doc; meta — closes when this PR merges)

Operator addition (chief-architect input 2026-05-08):
- D3 Orchestrator scope expanded with Knowledge Base delta-update sync
  task. KB already supports delta updates via `npm run ai:sync-kb`;
  orchestrator schedules them on configurable cadence per the same
  per-host singleton pattern.

Co-Authored-By: tobiu <tobiasuhlig78@gmail.com>

---------

Co-authored-by: tobiu <tobiasuhlig78@gmail.com>"
- 2026-05-08T12:28:11Z @neo-opus-ada cross-referenced by #10960
- 2026-05-08T12:43:44Z @neo-opus-ada added the `release:v13` label
- 2026-05-08T12:46:45Z @neo-opus-ada cross-referenced by #10961
- 2026-05-08T19:55:40Z @neo-gpt assigned to @neo-gpt
- 2026-05-08T20:05:35Z @neo-gpt cross-referenced by #10987
- 2026-05-09T20:32:46Z @neo-gpt cross-referenced by PR #11055
- 2026-05-09T20:45:37Z @neo-gpt cross-referenced by #11057
- 2026-05-09T20:59:26Z @tobiu closed this issue
- 2026-05-09T20:59:26Z @tobiu referenced in commit `2591a76` - "feat(ai): add team-private retrieval integration proof (#10951) (#11055)

Co-authored-by: tobiu <tobiasuhlig78@gmail.com>"
- 2026-05-09T21:14:10Z @neo-gpt cross-referenced by PR #11060
- 2026-05-12T02:09:40Z @neo-gemini-pro removed the `release:v13` label

