Fixed three critical bugs in v5.3.0: 1. COW ref resolution bug (lines 2354, 2856, 2895 in src/brainy.ts): - getHistory(), commit(), deleteBranch() were prepending 'heads/' to branch names - This caused RefManager to resolve 'heads/main' to 'refs/heads/heads/main' - Actual ref file at 'refs/heads/main' could not be found - Result: "Ref not found: heads/main" error breaking all COW operations 2. VersionManager commitHash bug (lines 212, 222 in src/versioning/VersionManager.ts): - save() was assigning entire Ref object to commitHash instead of ref.commitHash - Expected string, got object causing type mismatches in version metadata 3. Test mock improvements (tests/unit/versioning/VersionManager.test.ts): - Fixed searchByMetadata to skip metadata check for 'type' property - Added glob pattern support for tag filtering (e.g. 'v1.*') - Added deleteNounMetadata mock - Fixed getNounMetadata to return null for missing version entities Fixes: - src/brainy.ts (3 lines): Remove 'heads/' prefix from ref resolution calls - src/versioning/VersionManager.ts (2 lines): Use ref.commitHash instead of ref - tests/unit/versioning/VersionManager.test.ts: Fix test mocks - tests/integration/history-ref-resolution-bug.test.ts: Add regression tests Test Results: - Before: 16 test failures - After: 0 failures in VersionManager tests, 1183/1208 total tests passing (98%) |
||
|---|---|---|
| .. | ||
| all-apis-comprehensive.test.ts | ||
| api-parameter-validation.test.ts | ||
| azure-storage.test.ts | ||
| brainy-complete.integration.test.ts | ||
| brainy-core.integration.test.ts | ||
| brainy-phase1c-integration.test.ts | ||
| commit-ref-bug.test.ts | ||
| count-synchronization.test.ts | ||
| cow-full-integration.test.ts | ||
| entity-confidence-weight.test.ts | ||
| find-unified-integration.test.ts | ||
| gcs-native-storage.test.ts | ||
| gcs-persistence-fix.test.ts | ||
| get-relations-fix.test.ts | ||
| history-ref-resolution-bug.test.ts | ||
| hnsw-rebuild.test.ts | ||
| image-import.test.ts | ||
| metadata-vector-exclusion.test.ts | ||
| phase3TypeFirstQuery.integration.test.ts | ||
| relationship-intelligence.test.ts | ||
| remaining-apis.test.ts | ||
| s3-storage.test.ts | ||
| smart-import.test.ts | ||
| typeAwareHNSW.integration.test.ts | ||
| typeInference.hybrid.integration.test.ts | ||
| typeInference.integration.test.ts | ||
| versioning.test.ts | ||
| vfs-and-graph-entities.test.ts | ||
| vfs-api-wiring.test.ts | ||
| vfs-debug.test.ts | ||
| vfs-import-verification.test.ts | ||
| vfs-knowledge-separation.test.ts | ||