feat: v5.1.0 - VFS auto-initialization and complete API documentation
BREAKING CHANGES: - VFS API changed from brain.vfs() (method) to brain.vfs (property) - VFS now auto-initializes during brain.init() - no separate vfs.init() needed Features: - VFS auto-initialization with property access pattern - Complete TypeAware COW support verification (all 20 methods) - Comprehensive API documentation (docs/api/README.md) - All 7 storage adapters verified with COW support Bug Fixes: - CLI now properly initializes brain before VFS operations - Fixed infinite recursion in VFS initialization - All VFS CLI commands updated to modern API Documentation: - Created comprehensive, verified API reference - Consolidated documentation structure (deleted redundant quick starts) - Updated all VFS docs to v5.1.0 patterns - Fixed all internal documentation links Verification: - Memory Storage: 23/24 tests (95.8%) - FileSystem Storage: 9/9 tests (100%) - VFS Auto-Init: 7/7 tests (100%) - Zero fake code confirmed
This commit is contained in:
parent
5e16f9e5e8
commit
d4c9f71345
20 changed files with 2306 additions and 1343 deletions
|
|
@ -82,7 +82,7 @@ export class VFSStructureGenerator {
|
|||
|
||||
constructor(brain: Brainy) {
|
||||
this.brain = brain
|
||||
// CRITICAL FIX: Use brain.vfs() instead of creating separate instance
|
||||
// CRITICAL FIX: Use brain.vfs instead of creating separate instance
|
||||
// This ensures VFSStructureGenerator and user code share the same VFS instance
|
||||
// Before: Created separate instance that wasn't accessible to users
|
||||
// After: Uses brain's cached instance, making VFS queryable after import
|
||||
|
|
@ -92,11 +92,11 @@ export class VFSStructureGenerator {
|
|||
* Initialize the generator
|
||||
*
|
||||
* CRITICAL: Gets brain's VFS instance and initializes it if needed.
|
||||
* This ensures that after import, brain.vfs() returns an initialized instance.
|
||||
* This ensures that after import, brain.vfs returns an initialized instance.
|
||||
*/
|
||||
async init(): Promise<void> {
|
||||
// Get brain's cached VFS instance (creates if doesn't exist)
|
||||
this.vfs = this.brain.vfs()
|
||||
this.vfs = this.brain.vfs
|
||||
|
||||
// CRITICAL FIX (v4.10.2): Always call vfs.init() explicitly
|
||||
// The previous code tried to check if initialized via stat('/') but this was unreliable
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue