fix: set verb.source/target to entity UUID instead of NounType
relate() was setting verb.source = fromEntity.type (a NounType like "concept") instead of the entity UUID. Cortex's graph index indexes by verb.source, so lookups by UUID found nothing — causing in-session reads to return 0 results. Also fixes: - PathResolver calling private getIdsFromChunks() → public getIds() - Plugin auto-detection removed; cortex loads only via explicit config - GraphVerb types accept number timestamps and sourceId/targetId aliases - Dead autoDetect() method removed from PluginRegistry - In-session regression tests added for getRelations after relate()
This commit is contained in:
parent
0ec3d85c39
commit
932fb9520b
6 changed files with 31 additions and 48 deletions
|
|
@ -33,13 +33,17 @@ describe('VFS restart persistence', () => {
|
|||
entityId = await brain.vfs.resolvePathToId('/chapter-1.txt')
|
||||
expect(entityId).toBeTruthy()
|
||||
|
||||
// Verify within same session
|
||||
// Verify within same session — entity, readdir, and relations
|
||||
const entity1 = await brain.get(entityId!)
|
||||
expect(entity1).not.toBeNull()
|
||||
|
||||
const entries1 = await brain.vfs.readdir('/')
|
||||
expect(entries1.length).toBeGreaterThan(0)
|
||||
|
||||
// In-session getRelations: root should have Contains relationship to the file
|
||||
const relations1 = await brain.getRelations({ from: rootId, type: VerbType.Contains })
|
||||
expect(relations1.length).toBeGreaterThan(0)
|
||||
|
||||
await brain.close()
|
||||
|
||||
// === SESSION 2: Read data after restart ===
|
||||
|
|
@ -100,6 +104,10 @@ describe('VFS restart persistence', () => {
|
|||
const docEntries1 = await brain.vfs.readdir('/docs')
|
||||
expect(docEntries1.length).toBe(2) // guide.txt + api.txt
|
||||
|
||||
// In-session getRelations: root should have Contains relationships
|
||||
const rootRelations1 = await brain.getRelations({ from: rootId, type: VerbType.Contains })
|
||||
expect(rootRelations1.length).toBeGreaterThan(0)
|
||||
|
||||
await brain.close()
|
||||
|
||||
// === SESSION 2: Verify all data persisted ===
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue