Fixed critical bug where fork() completed without errors but branches were not persisted to storage, causing checkout() to fail with "Branch does not exist" errors. Root Cause: - COW metadata paths (_cow/*) were being branch-scoped incorrectly - resolveBranchPath() applied branch prefixes to COW paths - Result: refs written to branches/main/_cow/... instead of _cow/... - COW metadata (refs, commits, blobs) must be global, not per-branch Changes: 1. baseStorage.ts (resolveBranchPath): - Bypass branch scoping for _cow/ paths - COW metadata now stored globally as designed - Fixes fork() persistence across all storage adapters 2. brainy.ts (fork): - Add branch creation verification after copyRef() - Throw descriptive error if branch wasn't created - Prevents silent failures in production 3. tests/integration/fork-persistence.test.ts: - Comprehensive integration tests for fork workflow - Tests: persist → listBranches → checkout - Covers Workshop snapshot use case - Verifies COW metadata is globally accessible Impact: - Affects: FileSystem, GCS, R2, S3, Azure storage adapters - Workshop snapshot restoration now works - Zero breaking changes, production-scale ready 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| 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-commit-storage.test.ts | ||
| cow-full-integration.test.ts | ||
| empty-tree-bug.test.ts | ||
| entity-confidence-weight.test.ts | ||
| find-unified-integration.test.ts | ||
| fork-persistence.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 | ||
| initial-commit-null-parent.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 | ||