Skip to content

Commit 8a84bfd

Browse files
phernandezclaude
andcommitted
docs: add testing section to SPEC-9
Add comprehensive testing flow documentation to SPEC-9 including: - Initial setup steps (login, status, bisync-setup) - Normal usage flow (create projects, sync, watch mode) - Command examples with expected behavior - Directory structure diagrams - Key testing points checklist This provides clear testing guidance for Phase 1-2 implementation. Related: SPEC-9 Multi-Project Bidirectional Sync Architecture 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: phernandez <paul@basicmachines.co>
1 parent 7b6d62b commit 8a84bfd

File tree

1 file changed

+134
-0
lines changed

1 file changed

+134
-0
lines changed

specs/SPEC-9 Multi-Project Bidirectional Sync Architecture.md

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -863,3 +863,137 @@ def validate_bisync_directory(bisync_dir: Path):
863863
- Existing `bm cloud project` users: Use `bm project` instead
864864
- Existing `bm cloud bisync` becomes `bm sync` in cloud mode
865865
- Config automatically migrates on first `bm cloud login`
866+
867+
868+
## Testing
869+
870+
871+
Initial Setup (One Time)
872+
873+
1. Login to cloud and enable cloud mode:
874+
bm cloud login
875+
# → Authenticates via OAuth
876+
# → Sets cloud_mode=true in config
877+
# → Sets BASIC_MEMORY_PROXY_URL environment variable
878+
# → All CLI commands now route to cloud
879+
880+
2. Check cloud mode status:
881+
bm cloud status
882+
# → Shows: Mode: Cloud (enabled)
883+
# → Shows: Host: https://cloud.basicmemory.com
884+
# → Checks cloud health
885+
886+
3. Set up bidirectional sync:
887+
bm cloud bisync-setup
888+
# Or with custom directory:
889+
bm cloud bisync-setup --dir ~/my-sync-folder
890+
891+
# This will:
892+
# → Install rclone (if not already installed)
893+
# → Get tenant info (tenant_id, bucket_name)
894+
# → Generate scoped IAM credentials
895+
# → Configure rclone with credentials
896+
# → Create sync directory (default: ~/basic-memory-cloud-sync/)
897+
# → Validate no conflict with mount directory
898+
# → Run initial --resync to establish baseline
899+
900+
Normal Usage
901+
902+
4. Create local project and sync:
903+
# Create a local project directory
904+
mkdir ~/basic-memory-cloud-sync/my-research
905+
echo "# Research Notes" > ~/basic-memory-cloud-sync/my-research/readme.md
906+
907+
# Run sync
908+
bm cloud bisync
909+
910+
# Auto-magic happens:
911+
# → Checks for new local directories
912+
# → Finds "my-research" not in cloud
913+
# → Creates project on cloud via POST /proxy/projects/projects
914+
# → Runs bidirectional sync (all projects)
915+
# → Syncs to bucket root (all projects synced together)
916+
917+
5. Watch mode for continuous sync:
918+
bm cloud bisync --watch
919+
# Or with custom interval:
920+
bm cloud bisync --watch --interval 30
921+
922+
# → Syncs every 60 seconds (or custom interval)
923+
# → Auto-registers new projects on each run
924+
# → Press Ctrl+C to stop
925+
926+
6. Check bisync status:
927+
bm cloud bisync-status
928+
# → Shows tenant ID
929+
# → Shows sync directory path
930+
# → Shows initialization status
931+
# → Shows last sync time
932+
# → Lists available profiles (safe/balanced/fast)
933+
934+
7. Manual sync with different profiles:
935+
# Safe mode (max 10 deletes, preserves conflicts)
936+
bm cloud bisync --profile safe
937+
938+
# Balanced mode (max 25 deletes, auto-resolve to newer) - default
939+
bm cloud bisync --profile balanced
940+
941+
# Fast mode (max 50 deletes, skip verification)
942+
bm cloud bisync --profile fast
943+
944+
8. Dry run to preview changes:
945+
bm cloud bisync --dry-run
946+
# → Shows what would be synced without making changes
947+
948+
9. Force resync (if needed):
949+
bm cloud bisync --resync
950+
# → Establishes new baseline
951+
# → Use if sync state is corrupted
952+
953+
Verify Cloud Mode Integration
954+
955+
10. Test that all commands work in cloud mode:
956+
# List cloud projects (not local)
957+
bm project list
958+
959+
# Create project on cloud
960+
bm project add "work-notes"
961+
962+
# Use MCP tools against cloud
963+
bm tool write-note --title "Test" --folder "my-research" --content "Hello"
964+
965+
# All of these work against cloud because cloud_mode=true
966+
967+
11. Switch back to local mode:
968+
bm cloud logout
969+
# → Sets cloud_mode=false
970+
# → Clears BASIC_MEMORY_PROXY_URL
971+
# → All commands now work locally again
972+
973+
Expected Directory Structure
974+
975+
~/basic-memory-cloud-sync/ # Your local sync directory
976+
├── my-research/ # Auto-created cloud project
977+
│ ├── readme.md
978+
│ └── notes.md
979+
├── work-notes/ # Another project
980+
│ └── tasks.md
981+
└── personal/ # Another project
982+
└── journal.md
983+
984+
# All sync bidirectionally with:
985+
bucket:/ # Cloud bucket root
986+
├── my-research/
987+
├── work-notes/
988+
└── personal/
989+
990+
Key Points to Test
991+
992+
1. ✅ Cloud mode toggle works (login/logout)
993+
2. ✅ Bisync setup validates directory (no conflict with mount)
994+
3. ✅ Local directories auto-create cloud projects
995+
4. ✅ All projects sync together (bucket root)
996+
5. ✅ No RCLONE_TEST files created
997+
6. ✅ Changes sync bidirectionally
998+
7. ✅ Watch mode continuous sync works
999+
8. ✅ Profile safety limits work (max_delete)

0 commit comments

Comments
 (0)