test(e2e): check memory isolation between real workspaces and the chat-scoped erase (P1.5, UF-039)

- The isolation journeys (B2.4, U2.3, U2.4, U9.3) create their workspaces
  first. They used made-up workspace ids, which the sidecar silently
  turned into personal memory, so they never compared two workspaces;
  such writes are now refused (UF-039).
- J3f follows the Memory Center on the memory contract: Erase removes
  every memory saved from the same chat and is offered only for memories
  with a chat session; the erased-sources panel is gone.
This commit is contained in:
shumeiko.it
2026-10-24 18:20:01 +02:00
parent 8a9ba09ad9
commit 1e6f423d73
3 changed files with 32 additions and 59 deletions

View File

@@ -76,6 +76,13 @@ async function saveMemory(request: APIRequestContext, content: string, workspace
});
}
/** Creates a real workspace; memory writes for a workspace that does not exist are refused (UF-039). */
async function createWorkspace(request: APIRequestContext, name: string): Promise<string> {
const res = await request.post(`${API}/api/workspaces`, { data: { name, group: 'E2E' } });
expect(res.ok()).toBe(true);
return (await res.json()).id as string;
}
async function searchMemory(request: APIRequestContext, query: string, workspace: string, limit = 5) {
return request.get(`${API}/api/memory/search?q=${encodeURIComponent(query)}&workspace=${encodeURIComponent(workspace)}&limit=${limit}`);
}
@@ -227,8 +234,8 @@ test.describe('B2 — Memory Persistence (vs ChatGPT / Claude Code / Hermes)', (
});
test('B2.4 — Memory isolation: 100% workspace separation (Hermes has no isolation)', async ({ request }) => {
const wsA = `isolation-bench-a-${Date.now()}`;
const wsB = `isolation-bench-b-${Date.now()}`;
const wsA = await createWorkspace(request, `isolation-bench-a-${Date.now()}`);
const wsB = await createWorkspace(request, `isolation-bench-b-${Date.now()}`);
const secretData = `BENCH-SECRET-${Math.random().toString(36).slice(2)}`;
await saveMemory(request, `Confidential: ${secretData}`, wsA);