fix: vfs.search() and vfs.findSimilar() now filter for VFS files only

- Added 'vfsType: file' filter to vfs.search() to exclude knowledge documents
- Added 'vfsType: file' filter to vfs.findSimilar() for consistency
- Fixed test failures caused by knowledge entities lacking .path property
- All 8 VFS API wiring tests now passing

This ensures API consistency - VFS search methods only return VFS entities
with proper path metadata, never knowledge documents.
This commit is contained in:
David Snelling 2025-10-24 12:25:47 -07:00
parent ce8530b714
commit 0dda9dc56f
2 changed files with 37 additions and 4 deletions

View file

@ -955,7 +955,10 @@ export class VirtualFileSystem implements IVirtualFileSystem {
limit: options?.limit || 10,
offset: options?.offset,
explain: options?.explain,
includeVFS: true // v4.4.0: VFS search must include VFS entities!
includeVFS: true, // v4.4.0: VFS search must include VFS entities!
where: {
vfsType: 'file' // v4.4.0: Only search VFS files, not knowledge documents
}
}
// Add path filter if specified
@ -1003,7 +1006,10 @@ export class VirtualFileSystem implements IVirtualFileSystem {
limit: options?.limit || 10,
threshold: options?.threshold || 0.7,
type: [NounType.File, NounType.Document, NounType.Media],
includeVFS: true // v4.4.0: VFS similarity search must include VFS entities!
includeVFS: true, // v4.4.0: VFS similarity search must include VFS entities!
where: {
vfsType: 'file' // v4.4.0: Only find similar VFS files, not knowledge documents
}
})
return results.map(r => {