Commit Graph

18 Commits

Author SHA1 Message Date
phernandez d749c7737f feat: SPEC-20 enhancements - cleanup, path normalization, and docs
This commit adds several critical improvements discovered during
manual testing of SPEC-20 project-scoped rclone sync:

**Critical Bug Fixes:**

1. Path Normalization (fixes path doubling bug)
   - API: Strip /app/data/ prefix in project_router.py
   - CLI: Defensive normalization in project.py
   - Rclone: Fix get_project_remote() path construction
   - Prevents files syncing to /app/data/app/data/project/

2. Rclone Flag Fix
   - Changed --filters-file to correct --filter-from flag
   - Fixes "unknown flag" error in sync and bisync

**Enhancements:**

3. Automatic Database Sync
   - POST to /{project}/project/sync after file operations
   - Keeps database in sync with files automatically
   - Skipped on --dry-run operations

4. Enhanced Project Removal
   - Clean up local sync directory (with --delete-notes)
   - Always remove bisync state directory
   - Always remove cloud_projects config entry
   - Informative messages about what was/wasn't deleted

5. Bisync State Reset Command
   - New: bm project bisync-reset <project>
   - Clears corrupted bisync metadata
   - Safe recovery tool for bisync issues

6. Improved Project List UI
   - Show Local Path column in cloud mode
   - Conditionally show/hide columns based on config
   - Prevent path truncation with no_wrap/overflow
   - Apply path normalization to display

**Documentation:**

7. Cloud CLI Documentation
   - Add troubleshooting: empty directory bisync issues
   - Add troubleshooting: bisync state corruption
   - Document bisync-reset command usage
   - Explain rclone bisync limitations

8. SPEC-20 Updates
   - Mark implementation complete
   - Document all enhancements in Implementation Notes
   - Update phase checklists with completed work
   - Add manual testing results

**Tests:**

9. Unit Tests for --local-path
   - Test config persistence with --local-path
   - Test no config without --local-path
   - Test tilde expansion
   - Test nested directory creation

All changes tested manually end-to-end.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: phernandez <paul@basicmachines.co>
2025-10-28 17:36:36 -05:00
phernandez db85186e37 fix: Remove obsolete tests for deleted sync functionality
Removed tests for:
- test_bisync_commands.py (tenant-wide bisync functions)
- test_cloud_utils.py (deprecated utilities)
- test_rclone_config.py (mount profiles)
- test_sync_commands_integration.py (removed sync command)

Fixed:
- Removed 'sync' import from commands/__init__.py

Tests now pass with SPEC-20 project-scoped architecture.

Signed-off-by: phernandez <paul@basicmachines.co>
2025-10-28 13:48:51 -05:00
phernandez daf5add9bb docs(SPEC-20): Mark Phase 5 cleanup as complete
All Phase 5 tasks completed:
- Removed mount_commands.py and all mount functionality
- Removed all tenant-wide bisync functions
- Removed bisync_config from config schema
- Simplified cloud setup command
- Removed top-level sync command
- All typecheck errors resolved

Signed-off-by: phernandez <paul@basicmachines.co>
2025-10-28 12:52:47 -05:00
phernandez c63bf1a332 docs: Mark SPEC-20 Phase 4 complete
All Phase 4 CLI integration tasks are complete:
- Added --local-path flag to project add command
- Added sync-setup, sync, bisync, check, ls commands
- Integrated with rclone_commands module
- All commands working with proper error handling

Optional tasks deferred for now:
- Update project list to show sync status
- Simplify cloud setup command
- Integration tests

Ready for Phase 5 cleanup.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: phernandez <paul@basicmachines.co>
2025-10-28 12:28:30 -05:00
phernandez ffe5aa46dc docs: Update SPEC-20 to mark Phase 2 and Phase 3 complete
Marked completed checklist items:

Phase 2 (Rclone Config Simplification):
- Updated configure_rclone_remote() to use basic-memory-cloud
- Removed add_tenant_to_rclone_config()
- Removed tenant_id from remote naming
- Tested rclone config generation
- Cleaned up deprecated import references

Phase 3 (Project-Scoped Rclone Commands):
- Created rclone_commands.py with full implementation
- Implemented all sync operations (sync, bisync, check, ls)
- Added helper functions and SyncProject dataclass
- Wrote 22 tests with 99% coverage
- Temporarily disabled mount commands

Both phases complete and tested. Ready for Phase 4.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: phernandez <paul@basicmachines.co>
2025-10-28 12:08:56 -05:00
phernandez 7c2b8b5a58 feat(rclone): Add simplified configure_rclone_remote() function (SPEC-20 Phase 2)
Add new configure_rclone_remote() that uses single remote name:
- Single remote: "basic-memory-cloud" (not tenant-specific)
- Simplifies from per-tenant remotes to one credential set per user
- Maintains backup_rclone_config() for safety
- Add comprehensive functional tests for rclone config
- Test remote configuration, updates, save/load operations

Old add_tenant_to_rclone_config() kept for backward compatibility
but will be removed in Phase 5.

Part of SPEC-20 Simplified Project-Scoped Rclone Sync.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: phernandez <paul@basicmachines.co>
2025-10-28 11:02:38 -05:00
phernandez a92741985a Add SPEC-20: Simplified Project-Scoped Rclone Sync
- Radical simplification of rclone integration
- Remove mount/bisync workflows complexity (6 profiles → 1 default)
- Introduce cloud_projects dict for sync configuration
- Project-scoped sync operations (explicit, no auto-discovery)
- Thin wrappers around rclone commands
- 74-task implementation checklist across 7 phases
- Supersedes SPEC-8 sync implementation

Signed-off-by: phernandez <paul@basicmachines.co>
2025-10-28 10:22:59 -05:00
Paul Hernandez e78345ff25 feat: Streaming Foundation & Async I/O Consolidation (SPEC-19) (#384)
Signed-off-by: phernandez <paul@basicmachines.co>
Co-authored-by: Claude <noreply@anthropic.com>
2025-10-21 09:03:59 -05:00
Paul Hernandez 53fb13b054 fix: Make project creation endpoint idempotent (#357)
Signed-off-by: phernandez <paul@basicmachines.co>
Co-authored-by: Claude <noreply@anthropic.com>
2025-10-15 19:27:41 -05:00
phernandez 962d88ea43 add specs-17/18
Signed-off-by: phernandez <paul@basicmachines.co>
2025-10-12 10:59:45 -05:00
Paul Hernandez 8d2e70cfc8 refactor: async client context manager pattern for cloud consolidation (#344)
Signed-off-by: phernandez <paul@basicmachines.co>
Co-authored-by: Claude <noreply@anthropic.com>
2025-10-09 19:09:47 -05:00
Paul Hernandez 53438d1eab feat: Add SPEC-15 for configuration persistence via Tigris (#343)
Signed-off-by: phernandez <paul@basicmachines.co>
Co-authored-by: Claude <noreply@anthropic.com>
2025-10-08 18:07:00 -05:00
Paul Hernandez c83d567917 fix: enable WAL mode and add Windows-specific SQLite optimizations (#316)
Signed-off-by: phernandez <paul@basicmachines.co>
Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: Paul Hernandez <phernandez@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
2025-10-03 21:10:09 -05:00
Paul Hernandez ace6a0f50d feat: CLI Subscription Validation (SPEC-13 Phase 2) (#327)
Signed-off-by: phernandez <paul@basicmachines.co>
Co-authored-by: Claude <noreply@anthropic.com>
2025-10-03 17:59:32 -05:00
Paul Hernandez 99a35a7fb4 feat: Cloud CLI cloud sync via rclone bisync (#322)
Signed-off-by: phernandez <paul@basicmachines.co>
Co-authored-by: Claude <noreply@anthropic.com>
2025-10-03 10:18:43 -05:00
Paul Hernandez 5da97e4820 feat: implement SPEC-11 API performance optimizations (#315)
Signed-off-by: phernandez <paul@basicmachines.co>
Co-authored-by: Claude <noreply@anthropic.com>
2025-09-26 14:34:46 -05:00
Paul Hernandez 2c5c606a39 feat: Implement cloud mount CLI commands for local file access (#306)
Signed-off-by: phernandez <paul@basicmachines.co>
Co-authored-by: Claude <noreply@anthropic.com>
2025-09-22 14:19:25 -05:00
Paul Hernandez a1d7792bdb feat: Implement SPEC-6 Stateless Architecture for MCP Tools (#298)
Signed-off-by: phernandez <paul@basicmachines.co>
Signed-off-by: Paul Hernandez <60959+phernandez@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Drew Cain <groksrc@users.noreply.github.com>
2025-09-21 20:39:19 -05:00