feat: add persona initialization
This commit is contained in:
@@ -57,4 +57,28 @@ describe('persistFactDrafts', () => {
|
||||
expect(facts).toEqual([]);
|
||||
expect(await db.getSpaceByName('persona:empty')).toBeNull();
|
||||
});
|
||||
|
||||
it('keeps fact source metadata consistent when a draft overrides source', async () => {
|
||||
const db = await createDb();
|
||||
|
||||
const [fact] = await persistFactDrafts(db, {
|
||||
spaceName: 'persona:source-test',
|
||||
domain: 'persona.biography',
|
||||
source: 'boxbrain:batch',
|
||||
facts: [
|
||||
{
|
||||
statement: 'Minji wrote a diary entry.',
|
||||
source: 'boxbrain:draft',
|
||||
topics: [{ name: 'Minji' }, { name: 'diary entry' }],
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
expect(fact?.source).toBe('boxbrain:draft');
|
||||
expect(fact?.metadata).toMatchObject({
|
||||
boxbrain: {
|
||||
source: 'boxbrain:draft',
|
||||
},
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user