231 Commits

Author SHA1 Message Date
Jamie Pine
95295b8303 refactor: Transition to leaderless hybrid sync architecture
- Removed leadership-related components from the sync infrastructure, including `LeadershipManager` and `sync_leadership` fields across various models.
- Implemented a new peer-to-peer sync model utilizing Hybrid Logical Clocks (HLC) for shared resources and state-based sync for device-owned data.
- Updated the `Syncable` trait and related modules to reflect the new architecture, ensuring seamless integration of state and log-based synchronization.
- Introduced `PeerLog` for managing device-specific changes and `PeerSync` for handling synchronization in the leaderless environment.
- Revised documentation to outline the new sync architecture and its implications for device synchronization, emphasizing the benefits of a leaderless approach.
2025-10-08 19:18:23 -07:00
Jamie Pine
e66e3befdd feat: Introduce Leader Removal Checklist and update sync documentation
- Added a comprehensive checklist for removing leader-related code in the transition to a leaderless hybrid sync model.
- Documented necessary changes across core infrastructure, service layer, library management, and network protocols to facilitate the removal of leadership components.
- Updated sync documentation to reflect the new architecture, emphasizing the leaderless approach and its implications for device synchronization.
- Included migration strategies and terminology updates to ensure clarity in the transition process.
2025-10-08 11:50:48 -07:00
Jamie Pine
c478b40c1a feat: Revise library sync architecture to leaderless hybrid model
- Updated the library sync system to utilize a leaderless hybrid model, enhancing real-time synchronization of shared resources.
- Implemented state-based sync for device-owned data and log-based sync with Hybrid Logical Clocks (HLC) for shared resources.
- Revised documentation to reflect architectural changes, including the removal of leader election and the introduction of per-device sync logs.
- Enhanced conflict resolution strategies using HLC for shared metadata, ensuring deterministic merging and consistency across devices.
- Updated implementation tasks and acceptance criteria for various components to align with the new architecture.
2025-10-08 11:15:52 -07:00
Jamie Pine
08adba6404 feat: Implement sync infrastructure with leader election and transaction management
- Introduced a comprehensive sync infrastructure, including a `Syncable` trait for models, enabling automatic logging of changes in a dedicated sync log database.
- Added `LeadershipManager` for managing leader election and lease tracking, ensuring reliable synchronization across devices.
- Implemented `TransactionManager` to handle atomic writes and sync logging, enhancing data integrity during state changes.
- Created a new `sync` module with necessary components such as `SyncLogDb`, `SyncLogEntry`, and sync protocol handlers for efficient communication between leader and follower devices.
- Developed integration tests to validate the sync functionality and ensure robust performance across various scenarios.
2025-10-08 06:35:28 -07:00
Jamie Pine
2216dbe120 cleanup docs 2025-10-08 04:19:14 -07:00
Jamie Pine
0f0471b978 feat: Add index integrity verification command to CLI
- Introduced `index verify` command to perform comprehensive integrity checks on the Spacedrive index.
- Implemented functionality to compare filesystem state with database entries, reporting discrepancies such as missing files, stale entries, and metadata mismatches.
- Added detailed output options for verification results, including a summary report of findings.
- Created associated input and output types for verification actions, enhancing the overall integrity management of the indexing system.
- Documented usage and examples in the CLI documentation for user guidance.
2025-10-08 03:50:38 -07:00
Jamie Pine
63f2f44f20 feat: Improve rename handling in macOS watcher with database integration
- Enhanced `MacOSHandler` to query the database for inode information when handling rename events, allowing detection of renamed files even when the old path no longer exists.
- Implemented `get_inode_from_db()` method to facilitate database lookups for inode retrieval.
- Updated `handle_single_rename_event()` to utilize the new database query logic, ensuring proper event emission and entry identity preservation.
- Registered and unregistered database connections for locations in `LocationWatcher`, improving rename detection accuracy.
- Added integration tests to validate rename functionality and ensure no duplicate entries are created during renames.
2025-10-08 00:45:20 -07:00
Jamie Pine
03cb298683 a truck load of docs 2025-10-07 20:31:12 -07:00
Jamie Pine
4494c2d070 refactor: Enhance API dispatcher to utilize ActionManager and QueryManager
- Updated `ApiDispatcher` to delegate action and query execution to `ActionManager` and `QueryManager`, respectively, improving separation of concerns.
- Refactored permission checks and action dispatching to ensure consistent handling across API calls.
- Introduced `QueryContext` for tracking query metadata, enhancing query execution with contextual information.
- Improved error handling by integrating new `QueryError` types for better clarity in query-related failures.
- Cleaned up obsolete code and updated import paths to reflect the new structure, ensuring maintainability and clarity.
2025-10-07 03:18:28 -07:00
Jamie Pine
29509636e1 feat: Enhance device pairing with QR code support and relay integration
- Added QR code generation for remote pairing, allowing users to scan codes for easier device connection.
- Updated CLI to include QR code display and manual entry options for pairing.
- Enhanced PairingCoordinator to handle QR code JSON, including NodeId and relay URL for improved connectivity.
- Implemented camera permission handling in iOS for QR code scanning functionality.
- Refactored networking service to support relay-based pairing, ensuring reliable connections across different networks.
- Added tests for relay-only pairing scenarios to validate functionality and reliability.
2025-10-07 01:49:11 -07:00
Jamie Pine
c5925f9768 docs: Add API infrastructure reorganization design document
Add comprehensive design document for reorganizing API infrastructure:
- Move cqrs.rs to infra/query/ for better symmetry with actions
- Move registry, type_extraction, api_types to infra/wire/
- Improve code organization and discoverability
- Clear separation of infrastructure vs business logic

This is Option A: Full consolidation with wire/ directory for all
wire protocol and type system concerns.
2025-10-06 23:16:24 -07:00
Jamie Pine
18397a312c feat: Implement device disconnection and reconnection fixes
- Added `session_keys` to the `Disconnected` state to preserve encryption keys for reconnection.
- Enhanced `set_device_connected` method to handle transitions from `Disconnected` to `Connected` states.
- Updated device query to include `Disconnected` devices, ensuring they remain visible in the device list.
- Improved overall device state management for seamless reconnection and stability in device connections.
2025-10-04 23:58:58 -07:00
Jamie Pine
910dce67f5 feat: Add new documentation and enhance CLI functionality
- Introduced three new markdown files: CLI_LIBRARY_SYNC_COMPLETE.md, IMPLEMENTATION_COMPLETE.md, and LIBRARY_SYNC_SETUP_IMPLEMENTATION.md for comprehensive documentation.
- Updated various CLI domain modules to improve argument handling and output formatting.
- Enhanced device, index, job, library, location, network, and search modules for better integration and user experience.
- Refactored code across multiple domains to improve maintainability and clarity.
2025-10-04 21:31:47 -07:00
Jamie Pine
54d36ab3f7 refactor: Update Embedded Core Management and Library Handling 2025-09-29 14:36:03 -07:00
Jamie Pine
79728fdb10 feat: Enhance Library Management and UI Components
- Introduced a new `LibraryCard` and `EmptyLibraryCard` components for improved library selection UI in the macOS app.
- Updated `LibrarySelector` to display current library information and allow users to switch libraries through a new button.
- Enhanced `MenuBarManager` to dynamically update the libraries menu based on available libraries and current selection.
- Refactored `DaemonConnector` to handle library-related events and refresh library statistics accordingly.
- Improved `LibraryInfo` structure to include optional statistics, enhancing data representation for libraries.
- Updated various UI components to utilize new library statistics, providing users with better insights into their libraries.
2025-09-25 05:29:09 -07:00
Jamie Pine
29190d8fff feat: Introduce unified API layer with session context and permission handling
- Created a new `infra/api` module to centralize API operations and enhance session management.
- Implemented `ApiDispatcher` to streamline operation execution with built-in authentication and authorization.
- Updated query and action signatures to accept `SessionContext`, improving context handling across the application.
- Added `Type` derive macro to various structs for better type safety and integration with Specta.
- Documented the design and migration path for the new API structure, ensuring clarity for future development.
2025-09-23 18:07:55 -07:00
Jamie Pine
10532916e7 refactor: Standardize query architecture and enhance type safety
- Introduced consistent Input/Output patterns for all queries, improving architectural clarity.
- Created dedicated input structs for each query to separate API concerns from execution logic.
- Updated query implementations to utilize new traits, ensuring better type safety and integration with Specta.
- Enhanced registration macros to support the new query structure, facilitating automatic type extraction for Swift generation.
- Documented the refactor plan and its benefits for future development and maintenance.
2025-09-23 18:07:30 -07:00
Jamie Pine
7327903b9f feat: Implement rspc-inspired type extraction system for operations and queries
- Introduced a trait-based type extraction system to automatically generate Input/Output types for registered operations and queries.
- Enhanced registration macros to implement the OperationTypeInfo and QueryTypeInfo traits, facilitating compile-time type discovery.
- Added new modules for type extraction and testing, ensuring comprehensive coverage and validation of the type extraction functionality.
- Documented the successful implementation and provided evidence of automatic trait implementations through compilation errors.
2025-09-23 15:26:37 -07:00
Jamie Pine
986292e023 refactor: Enhance type safety and organization in file operations
- Added `Type` derive macro to several structs and enums across file operations to improve type safety and integration with Specta.
- Reorganized module imports in `mod.rs` for better clarity and structure.
- Introduced a new documentation file on dynamic type generation for the Swift client, detailing the implementation of type-safe API generation techniques.
2025-09-23 01:48:14 -07:00
Jamie Pine
94526824e6 feat: Add pause and resume functionality for jobs in Spacedrive
- Implemented pauseJob and resumeJob methods in DaemonConnector to manage job states.
- Updated SharedAppState to handle new pause and resume actions.
- Introduced JobActionButton in JobRowView for user interaction to pause or resume jobs.
- Enhanced launch configuration in VSCode for debugging Spacedrive applications.
2025-09-22 20:15:27 -07:00
Jamie Pine
c4f667b8a2 refactor: Clean up Swift client and remove obsolete files
- Added a warning suppression directive in the Rust CLI main file to reduce noise during compilation.
- Deleted several Swift files related to job management and UI components, streamlining the codebase and focusing on essential functionality.
- Updated the main application structure to enhance window management and user experience.
- Improved the organization of action context handling in the Rust core, facilitating better job dispatching with action context awareness.
2025-09-22 18:17:58 -07:00
Jamie Pine
e5bc6bb9b9 refactor: Update schema generation and type handling
- Renamed `common_types` to `core_types` in `UnifiedSchema` for clarity.
- Updated schema extraction methods to reflect the new naming convention.
- Enhanced the `register_schema_type` macro for better type registration in schema generation.
- Added `JsonSchema` derives to various structs to support schema extraction.
- Improved logging in `generate_schemas` to provide accurate output details.
- Updated documentation to reflect changes in schema structure and type handling.
2025-09-21 10:40:22 -07:00
Jamie Pine
487cc53e63 feat: Implement JSON Schema generation for client types
- Added `schemars` dependency to facilitate JSON Schema generation.
- Introduced a new `generate_schemas` binary for extracting and writing unified JSON schemas.
- Enhanced existing modules to support schema generation, including updates to `build.rs` for change detection.
- Updated various data structures with `JsonSchema` derives to enable schema extraction.
- Created comprehensive documentation for the client generation system design, detailing architecture and usage.
- Added TypeScript and Swift client generation scripts, ensuring type-safe access to the Spacedrive daemon API.
2025-09-21 10:40:13 -07:00
Jamie Pine
b46042f9b6 feat: Add desktop-scale benchmark recipes for realistic testing
- Introduced two new benchmark recipes: `desktop_complex.yaml` and `desktop_extreme.yaml`.
- `desktop_complex.yaml` simulates a realistic desktop environment with 500k files and 8 levels of directory nesting.
- `desktop_extreme.yaml` targets power users with 1M files and 12 levels, featuring a comprehensive file type coverage and realistic size distribution.
- Updated documentation to include details about the new benchmark recipes and their intended use cases.
2025-09-20 03:22:25 -07:00
Jamie Pine
8465b50885 refactor: Remove networking flag from CLI commands and documentation
- Eliminated the `--enable-networking` flag from the `start` and `restart` commands in the CLI, simplifying the command structure.
- Updated related documentation to reflect the removal of the networking option, ensuring consistency across usage examples.
- Adjusted the daemon to always enable networking, streamlining the startup process for users.
2025-09-19 19:28:21 -07:00
Jamie Pine
aa1a8d8c00 Enhance file copy operations with new copy method options and CLI support
- Updated `CopyMethod` enum to include `Atomic` and `Streaming` variants, replacing the previous `AtomicMove` and `StreamingCopy` options for clarity.
- Refactored the `select_strategy` method to respect user preferences for copy methods, improving the logic for same-volume operations.
- Added CLI support for the new copy methods in `args.rs`, allowing users to specify their preferred method during file copy operations.
- Updated relevant tests to reflect changes in copy method naming and functionality.
- Enhanced documentation to include new copy method options and their usage.

Co-authored-by: ijamespine <ijamespine@me.com>
2025-09-19 13:05:18 -07:00
Jamie Pine
6593b88ad0 Remove obsolete files and documentation related to architecture, Cargo configuration, and integration summaries
- Deleted `ARCHITECTURE.md`, `Cargo.toml.bak`, and various integration summary files to streamline the codebase.
- Removed outdated demo files and testing guides that are no longer relevant.
- Cleaned up the repository by eliminating unnecessary documentation and binary files, ensuring a more maintainable project structure.

Co-authored-by: ijamespine <ijamespine@me.com>
2025-09-18 20:44:55 -07:00
Jamie Pine
10c5da0fed feat: Add Library Info command and refactor library argument handling
- Introduced `LibraryInfoArgs` struct for querying library information, allowing optional library ID input.
- Implemented `to_query` method for `LibraryInfoArgs` to facilitate query creation.
- Updated `LibraryCmd` enum to include `Info` variant for handling library information requests.
- Refactored argument handling in `args.rs` for improved readability and consistency.
- Enhanced `run` function in `mod.rs` to process the new `Info` command and display detailed library information.

Co-authored-by: ijamespine <ijamespine@me.com>
2025-09-18 18:10:37 -07:00
Jamie Pine
b330807c0e Implement FS Event Pipeline Testing Guide and update Cargo.toml for CLI name change
- Added a comprehensive testing guide for the FS Event Pipeline, detailing metrics collection, logging, and troubleshooting steps.
- Updated the CLI package name from "spacedrive-cli" to "sd-cli" in Cargo.toml for consistency.
- Modified various files to reflect the new package structure and improve logging and metrics handling.

Co-authored-by: ijamespine <ijamespine@me.com>
2025-09-18 15:31:25 -07:00
Cursor Agent
04b544e0f0 feat: Design FS event pipeline resilience and correctness
Co-authored-by: ijamespine <ijamespine@me.com>
2025-09-17 22:56:01 +00:00
Jamie Pine
da9d2d290a Merge pull request #15 from jamiepine/cursor/develop-complex-tags-system-from-whitepaper-63cf 2025-09-16 17:57:56 -07:00
Jamie Pine
f1cf97f0d6 refactor: Rename user_metadata_manager to manager and update references
- Renamed the `user_metadata_manager` module to `manager` for consistency and clarity.
- Updated all references to `UserMetadataManager` across the codebase to reflect the new module name.
- Adjusted documentation to point to the new module location.

This refactor enhances the organization of the metadata management system, improving maintainability and readability.
2025-09-15 18:14:43 -07:00
Jamie Pine
a01addb944 refactor: Transition to a unified tagging system and remove semantic tag references
- Renamed and restructured the tagging modules, replacing `semantic_tag` with `tag` for consistency across the codebase.
- Updated all references in the domain, operations, and database layers to reflect the new naming conventions.
- Removed deprecated files and entities related to the old semantic tagging system, including `semantic_tag.rs` and `metadata_tag.rs`.
- Enhanced the organization of the tagging system, improving clarity and maintainability for future development.

This commit streamlines the tagging architecture, paving the way for advanced features and improved usability.
2025-09-15 16:56:21 -07:00
Jamie Pine
578c1971d4 refactor: Simplify semantic tag module structure and remove deprecated files
- Renamed `semantic_tag_manager` to `manager` and `semantic_tagging_facade` to `facade` for clarity and consistency.
- Removed the `semantic_tag_manager.rs` and `semantic_tagging_facade.rs` files as part of the restructuring.
- Updated module imports and re-exports in `mod.rs` to reflect the new naming conventions.
- Cleaned up whitespace in the codebase for improved readability.

This commit enhances the organization of the semantic tagging system, paving the way for future development.
2025-09-15 15:44:23 -07:00
Cursor Agent
48869853ac feat: Implement Spacedrive semantic tagging system
Co-authored-by: ijamespine <ijamespine@me.com>
2025-09-15 21:20:19 +00:00
Cursor Agent
ac0c298e2a feat: Implement semantic tagging foundation
Co-authored-by: ijamespine <ijamespine@me.com>
2025-09-15 21:12:19 +00:00
Cursor Agent
ae04f7b7d6 feat: Implement advanced semantic tagging system
Co-authored-by: ijamespine <ijamespine@me.com>
2025-09-15 20:51:10 +00:00
Jamie Pine
cde3f04698 refactor: Improve error handling and update documentation for CLI
- Enhanced error handling in `error.rs` to provide more informative messages.
- Updated documentation to reflect recent changes in error management practices.
- Improved clarity in the CLI commands by refining error reporting mechanisms.
2025-09-15 13:49:31 -07:00
Jamie Pine
7b9e2d8dd6 chore: Update dependencies and enhance error handling in CLI
- Updated `bincode` dependency to version 1.3.3 for improved performance and security.
- Refactored error handling in `error.rs` to use `bincode::Error` instead of `bincode::ErrorKind`, ensuring better error management.
- Enhanced macro definitions in `macros.rs` to utilize the updated error handling structure.
- Improved error reporting in `manager.rs` when creating directories, providing clearer context for IO errors.
- Added a new design document for Sync Conduits, detailing the architecture and implementation plan for file synchronization in Spacedrive.
2025-09-15 11:45:21 -07:00
Jamie Pine
d439d69590 feat: Finalize Spacedrive refactor and enhance session management
- Added a new documentation file outlining the finalization plan for the Spacedrive refactor, detailing remaining tasks and objectives for migrating to a CQRS architecture.
- Implemented session state management to track the current library context across operations, improving the overall architecture's modularity and maintainability.
- Refactored CLI commands and core components to utilize the new session state service, ensuring a more consistent and error-free user experience.
- Enhanced error handling and logging in various modules to facilitate debugging and improve reliability.
2025-09-13 16:08:07 -07:00
Jamie Pine
f6edb570c4 fix: update subproject commit and enhance action registration
- Updated the subproject commit to indicate a dirty state.
- Commented out the unused import of `PathBuf` in `daemon.rs` for clarity.
- Added a test module in `registry.rs` to list registered operations and ensure at least one action or query is registered.
- Registered core actions for library creation, deletion, export, renaming, and location management, improving modularity and consistency in action handling.

These changes enhance the reliability of the operation registration process and improve code clarity.
2025-09-10 19:48:11 -04:00
Jamie Pine
13df73bef0 refactor: streamline action and query structures
- Removed unnecessary whitespace in `cqrs.rs` to enhance code cleanliness.
- Reorganized imports in `addressing.rs` for better clarity and consistency.
- Introduced new input types for actions, including `Input` associated types in `CoreAction` and `LibraryAction`, promoting a more modular design.
- Updated action implementations to utilize the new input structures, improving maintainability and reducing redundancy.
- Enhanced event handling in `event.rs` to ensure proper library ID filtering.

These changes improve the overall structure and maintainability of the action and query systems while ensuring a consistent API surface.
2025-09-10 17:34:11 -04:00
Jamie Pine
25db936675 feat: introduce unified op! macro for operation registration
- Added the `op!` macro to streamline the registration of library actions, core actions, and queries, reducing boilerplate and promoting consistency across the codebase.
- Implemented helper macros for generating method strings for actions and queries, enhancing clarity in operation declarations.
- Updated existing file operations (copy, delete, duplicate detection) to utilize the new macro, simplifying their input and action structures.
- Introduced comprehensive documentation for the operations initialization API, outlining usage patterns and conversion mechanisms.

These changes significantly enhance the modularity and maintainability of the operation registration process while ensuring a consistent API surface.
2025-09-10 15:40:13 -04:00
Jamie Pine
5c6735ea28 refactor: rename action registration macros for clarity
- Updated the action registration macros from `register_action_input!` to `register_library_action_input!` to better reflect their purpose and improve clarity in the codebase.
- Adjusted related documentation and input structures to ensure consistency with the new naming convention.
- Enhanced the organization of input types for file operations and library management, promoting better modularity and maintainability.

These changes improve the clarity and consistency of the action registration process across the codebase.
2025-09-10 13:14:30 -04:00
Jamie Pine
3566fa7838 refactor: enhance action and query handling with dynamic registry
- Introduced a dynamic registry for actions and queries, allowing for self-registration and improved modularity.
- Updated the `Core` struct to support new methods for executing actions and queries by method string, enhancing flexibility.
- Refactored the `CoreClient` to utilize a `METHOD` constant for action dispatching, improving clarity.
- Removed legacy action handling code and streamlined the `RpcServer` for better request management.
- Enhanced input structures for file operations and library management, ensuring type safety and consistency.

These changes significantly improve the modularity and maintainability of the action system while ensuring a consistent API surface.
2025-09-10 12:59:55 -04:00
Jamie Pine
1f2c38b440 refactor: introduce CLI application structure and enhance command handling
- Added a new `apps/cli` module to encapsulate the CLI application logic, improving organization and modularity.
- Updated `Cargo.toml` to include dependencies for the CLI, such as `clap` for command-line argument parsing.
- Implemented a `Context` struct to manage application state and core client interactions.
- Created command handling for file operations and library management, enhancing user experience and functionality.
- Introduced utility functions for output formatting, supporting both human-readable and JSON outputs.

These changes significantly enhance the structure and maintainability of the CLI application while providing a more robust user interface.
2025-09-09 20:04:20 -04:00
Jamie Pine
56782b237b refactor: update action system to modular structure with CoreAction and LibraryAction
- Refactored the action system to implement distinct `CoreAction` and `LibraryAction` traits, enhancing modularity and clarity.
- Removed the old `ActionTrait` and associated boilerplate, streamlining action implementations.
- Updated multiple actions to utilize the new traits, ensuring type safety and reducing redundancy in library validation.
- Enhanced the `ActionManager` to support generic dispatch for both core and library actions, preserving existing validation and logging infrastructure.

These changes significantly improve the maintainability and extensibility of the action system while ensuring a consistent API surface.
2025-09-09 11:10:33 -04:00
Jamie Pine
469fc7cbe2 refactor: complete migration to modular action system and remove ActionOutput enum
- Eliminated the centralized `ActionOutput` enum, achieving true modularity in action handling.
- Introduced the `ActionType` trait, allowing each action to define its own output type directly.
- Updated multiple actions to utilize native output types, enhancing type safety and reducing complexity.
- Enhanced the `ActionManager` with a generic `dispatch_action` method for improved action execution.
- Preserved existing infrastructure for validation, audit logging, and error handling throughout the migration.

These changes significantly improve the modularity and maintainability of the action system while ensuring a consistent API surface.
2025-09-09 02:03:17 -04:00
Jamie Pine
478f3136c5 refactor: enhance CQRS implementation with modular command and query traits
- Updated the `Command` trait to support modular output types, eliminating the need for a centralized `ActionOutput` enum.
- Refactored the `execute_command` function for direct command execution, improving type safety and performance by avoiding unnecessary JSON serialization.
- Implemented the new `ListLibrariesQuery` and associated output types for library listing operations, enhancing the query capabilities of the API.
- Updated existing actions like `LibraryCreateAction` and `VolumeTrackAction` to utilize the new modular command structure, simplifying their implementations.

These changes improve the modularity and maintainability of the action system while preserving existing functionality.
2025-09-08 20:08:44 -04:00
Jamie Pine
5f68a0d697 refactor: implement CQRS pattern with Command and Query traits
- Introduced a new `Command` trait to streamline action execution, reducing boilerplate and enhancing type safety.
- Updated the `Core` API to include `execute_command` and `execute_query` methods, providing a unified interface for command and query operations.
- Implemented the `Command` trait for `LibraryCreateAction`, ensuring compatibility with existing ActionManager functionality.
- Enhanced the API design documentation to reflect the new CQRS structure and its benefits.

These changes improve the clarity and maintainability of the action system while preserving existing functionality.
2025-09-08 19:36:37 -04:00