test(server): stop seeding a legacy personal mind (P1.5)
The server no longer opens personal.mind, so tests build it on an empty data directory. The /memory command test seeds its two memories through server.memory and now checks that the seeded text is found.
This commit is contained in:
@@ -2,7 +2,7 @@ import { describe, it, expect, beforeAll, afterAll } from 'vitest';
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import os from 'node:os';
|
||||
import { MindDB, SessionStore, FrameStore } from '@waggle/core';
|
||||
import { PERSONAL_SCOPE } from '@waggle/memory-contract';
|
||||
import { buildLocalServer } from '../../src/local/index.js';
|
||||
import type { FastifyInstance } from 'fastify';
|
||||
import { injectWithAuth } from '../test-utils.js';
|
||||
@@ -14,17 +14,16 @@ describe('Command Execution Route', () => {
|
||||
beforeAll(async () => {
|
||||
tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'waggle-cmd-test-'));
|
||||
|
||||
// Create personal.mind (required by buildLocalServer)
|
||||
const personalPath = path.join(tmpDir, 'personal.mind');
|
||||
const mind = new MindDB(personalPath);
|
||||
const sessions = new SessionStore(mind);
|
||||
const frames = new FrameStore(mind);
|
||||
const s1 = sessions.create('test');
|
||||
frames.createIFrame(s1.gop_id, 'Test memory about architecture decisions', 'normal');
|
||||
frames.createIFrame(s1.gop_id, 'Another memory about deployment', 'important');
|
||||
mind.close();
|
||||
|
||||
server = await buildLocalServer({ dataDir: tmpDir });
|
||||
await server.memory.remember({
|
||||
scope: PERSONAL_SCOPE,
|
||||
text: 'Test memory about architecture decisions',
|
||||
});
|
||||
await server.memory.remember({
|
||||
scope: PERSONAL_SCOPE,
|
||||
text: 'Another memory about deployment',
|
||||
importance: 'important',
|
||||
});
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
@@ -75,7 +74,7 @@ describe('Command Execution Route', () => {
|
||||
const body = JSON.parse(res.body);
|
||||
expect(body.command).toBe('/memory architecture decisions');
|
||||
expect(body.result).toContain('Memory Search');
|
||||
expect(body.result).toContain('architecture decisions');
|
||||
expect(body.result).toContain('Test memory about architecture decisions');
|
||||
});
|
||||
|
||||
it('POST /api/commands/execute with /catchup returns workspace state', async () => {
|
||||
|
||||
Reference in New Issue
Block a user