From fbf26051b5fe64eb67ab2f309ece8c52e8dffb79 Mon Sep 17 00:00:00 2001 From: David Snelling Date: Fri, 24 Oct 2025 12:31:42 -0700 Subject: [PATCH] fix: add includeVFS to initializeRoot() - prevents duplicate root creation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CRITICAL BUG FIX: VFS.initializeRoot() was calling brain.find() without includeVFS: true, causing it to exclude VFS entities. This meant it could never find an existing VFS root, and would create a new one on every init. This directly caused the Workshop team's issue with ~10 duplicate roots! All VFS internal methods that call brain.find() or brain.similar() now correctly use includeVFS: true: - ✅ initializeRoot() (line 171) - JUST FIXED - ✅ search() (line 958) - ✅ findSimilar() (line 1009) - ✅ searchEntities() (line 2327) --- src/vfs/VirtualFileSystem.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/vfs/VirtualFileSystem.ts b/src/vfs/VirtualFileSystem.ts index 619e89a0..ef1b95d6 100644 --- a/src/vfs/VirtualFileSystem.ts +++ b/src/vfs/VirtualFileSystem.ts @@ -167,7 +167,8 @@ export class VirtualFileSystem implements IVirtualFileSystem { path: '/', // ✅ Correct field name vfsType: 'directory' // ✅ Correct field name }, - limit: 10 + limit: 10, + includeVFS: true // v4.4.0: CRITICAL - Must find VFS root entity! }) if (existing.length > 0) {