Commit Graph

3355 Commits

Author SHA1 Message Date
Jamie Pine
e2d967af1e Remove obsolete test result documentation for job pause/resume and shutdown pause implementations 2025-07-23 16:11:48 -07:00
Jamie Pine
14501a5714 feat(agent-manager): Introduce Agent Manager design document
- Added a comprehensive design document for the Spacedrive Agent Manager, detailing its vision, core concepts, architecture, and key features.
- The document outlines the integration of AI agents, git worktree management, terminal session handling, and community interaction.
- Emphasizes the benefits of Spacedrive integration, including performance, filesystem access, and networking capabilities.
- Provides a roadmap for implementation phases and security considerations, setting the foundation for future development.

This addition aims to enhance understanding and collaboration around the Agent Manager's development and functionality.
2025-07-19 18:31:03 -07:00
Jamie Pine
7f4817a607 feat(jobs): Pause running jobs during shutdown
- Update JobManager::shutdown() to pause all running jobs before shutdown
- Add Library::shutdown() method that calls JobManager::shutdown()
- Update LibraryManager to call library.shutdown() when closing
- Add timeout protection (10s) to prevent hanging during shutdown
- Create tests and demo showing shutdown behavior

This ensures that long-running jobs (like indexing) don't lose progress
when Spacedrive shuts down. Jobs are paused with their state saved to
database and will automatically resume on next startup.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-15 01:49:25 -04:00
Jamie Pine
7ffa64b599 feat(jobs): Implement pause and resume functionality for job manager
- Add pause_job() method to JobManager that updates job state and saves to database
- Add resume_job() method that handles both in-memory and persisted job resumption
- Update job executor to differentiate between pause and cancel interruptions
- Add JobPaused and JobResumed events to the event system
- Implement CLI command handlers for pause and resume operations
- Add comprehensive tests and example programs demonstrating the functionality

Key features:
- Jobs can be paused while running and will freeze their progress
- Paused jobs persist their state to database for resumption after restart
- Resume intelligently handles both in-memory and database-persisted jobs
- Progress is maintained accurately through pause/resume cycles
- Proper error handling for invalid state transitions

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-15 00:49:38 -04:00
Jamie Pine
907229c8a0 Remove obsolete job system documentation and related test files
- Deleted the `fix_job_system.md` and `JOB_CLEANUP_FIX.md` files, which contained outdated information regarding job system issues and fixes.
- Removed associated test files that were no longer relevant to the current implementation of the job management system.
- This cleanup helps streamline the documentation and testing structure, ensuring that only current and relevant information is maintained.

These changes aim to improve project organization and clarity by eliminating obsolete content.
2025-07-13 19:30:35 -07:00
Jamie Pine
3416006cf3 Update Cargo.toml and Introduce Landing Page Design Document
- Added `strum` dependency to `Cargo.toml` for enhanced enum handling.
- Removed the deprecated `monitoring` module from the CLI structure to streamline code organization.
- Introduced a new design document for a landing page concept, outlining features for real-time app development insights and automated updates.

These changes aim to improve dependency management, enhance code clarity, and provide a foundation for future UI development.
2025-07-13 14:51:19 -07:00
Jamie Pine
c76d55da1a Enhance Job Management with Progress Tracking and Status Updates
- Introduced a new `update_progress` method in the JobDb to persist job progress in the database, improving tracking of job execution.
- Implemented atomic updates for job status and progress in the `update_status_and_progress` method, ensuring consistency during state changes.
- Enhanced the JobExecutor to handle final progress updates and status changes, including completion, failure, and cancellation, with appropriate logging.
- Updated the JobManager to monitor job completion and emit events for job status changes, improving event-driven architecture.
- Refactored progress handling in various job phases to ensure accurate reporting and database updates, enhancing overall job management capabilities.

These changes aim to provide a more robust and responsive job management system, facilitating better tracking and user feedback during job execution.
2025-07-11 22:05:05 -07:00
Jamie Pine
aca0793910 Refactor CLI Command Structure and Remove Deprecated Domains
- Introduced a new `commands` module to streamline command handling within the CLI, enhancing organization and maintainability.
- Removed outdated domain modules (`daemon`, `library`, `location`, `job`, `network`, `file`, `system`) to simplify the codebase and eliminate redundancy.
- Updated command imports and usage throughout the CLI to reflect the new structure, ensuring all functionalities remain intact.
- Enhanced the `Cli` struct and command handling logic to support the new modular approach, improving clarity and usability.

These changes aim to provide a cleaner and more efficient command structure within the CLI, facilitating future enhancements and maintenance.
2025-07-11 20:07:05 -07:00
Jamie Pine
59d7ed7387 Implement New Library Actions and Refactor CLI Command Handlers
- Introduced new actions for library management, including `LibraryRename`, `LibraryExport`, `LocationRescan`, and `DeviceRevoke`, enhancing the functionality of the action system.
- Updated the `Action` enum to accommodate new actions and modified the `library_id` retrieval logic accordingly.
- Refactored CLI command handlers to utilize the new action system, improving command execution for indexing and location management.
- Enhanced the `FileHandler` and `LocationHandler` to support new commands and improve error handling and user feedback.

These changes aim to provide a more robust and flexible library management system within the CLI, enhancing user experience and operational capabilities.
2025-07-11 20:01:04 -07:00
Jamie Pine
dd1f76da57 Enhance CLI Documentation and Refactor Daemon Architecture
- Updated the CLI documentation to include new features such as networking support, multiple daemon instances, and comprehensive logging.
- Introduced a modular architecture for the daemon, improving maintainability, extensibility, and type safety.
- Added commands for managing multiple daemon instances and enhanced file operations with progress tracking.
- Improved the organization of command handling and logging within the daemon, ensuring better separation of concerns and testability.

These changes aim to provide clearer documentation and a more robust architecture for the Spacedrive CLI and daemon.
2025-07-11 19:06:40 -07:00
Jamie Pine
c98be15f7b Refactor Daemon Command and Response Structures for Improved Clarity
- Reformatted the `DaemonCommand` and `DaemonResponse` enums to enhance readability and maintainability by aligning fields and adding commas for consistency.
- Updated the `setup_file_logging_static` function to improve logging initialization clarity.
- Cleaned up whitespace and formatting throughout the `daemon.rs` file to ensure a more organized code structure.

These changes aim to streamline the codebase and improve the overall clarity of the daemon's command and response handling.
2025-07-11 17:35:28 -07:00
Jamie Pine
b82e7882b1 Merge pull request #2 from jamiepine/iroh
Iroh
2025-07-11 17:09:00 -07:00
Jamie Pine
5d9eedfc0f Remove outdated design documents for CLI output refactor and Iroh migration
- Deleted the `cli-output-refactor.md` and `IROH_MIGRATION_DESIGN.md` files as they are no longer relevant to the current architecture and implementation.
- These documents contained proposals and designs that have been superseded by recent changes in the networking module and CLI output handling.

This cleanup helps maintain a more organized and up-to-date documentation structure within the project.
2025-07-11 17:06:09 -07:00
Jamie Pine
27c73b2421 Integrate logging into NetworkingEventLoop and DeviceRegistry
- Added a logger to the NetworkingEventLoop for improved error handling and event tracking, replacing `println!` statements with structured logging calls.
- Enhanced the DeviceRegistry to include logging capabilities, ensuring all significant operations are logged for better traceability.
- Updated various methods to utilize the logger for consistent logging of events, errors, and state changes, improving overall maintainability and debugging.

These changes aim to enhance the observability and reliability of the networking module by providing comprehensive logging throughout its operations.
2025-07-11 16:58:17 -07:00
Jamie Pine
172627c702 Enhance file transfer logging with message truncation
- Introduced a helper function to create truncated representations of `FileTransferMessage` for improved logging clarity.
- Updated logging statements to utilize the new truncation function, ensuring sensitive data is not fully exposed while maintaining essential information.
- Refined the logging of transfer completions to display a shortened checksum for better readability.

These changes aim to enhance the traceability and security of file transfer operations within the networking module.
2025-07-11 16:31:35 -07:00
Jamie Pine
3efbbc946c Enhance NetworkingService with logging capabilities
- Integrated a logging system into the NetworkingService to improve traceability of network operations.
- Updated the constructor to accept a logger instance, ensuring all significant events and errors are logged.
- Replaced `println!` statements with structured logging calls for better consistency and clarity in output.
- Enhanced error handling and user feedback during device reconnections and pairing processes.

These changes aim to improve the reliability and maintainability of the networking module by providing comprehensive logging throughout its operations.
2025-07-11 16:23:43 -07:00
Jamie Pine
4ac62b6037 Refactor CLI output handling for improved consistency and clarity
- Updated various CLI command handlers to utilize a more structured output system, enhancing the readability and organization of displayed information.
- Modified the `handle_copy_command`, `handle_pairing_command`, and `handle_status_command` functions to streamline output section creation and item addition.
- Improved user feedback by refining output messages, ensuring clarity in command responses and instructions.

These changes aim to enhance the user experience by providing clearer and more consistent output across CLI commands.
2025-07-11 16:11:23 -07:00
Jamie Pine
16b7faef11 Merge main into iroh branch 2025-07-11 16:04:05 -07:00
Jamie Pine
77cc77bd67 Enhance file transfer protocol with logging and session management improvements
- Updated the `FileTransferProtocolHandler` to include a logger for better tracking of protocol operations.
- Modified the constructor to accept a logger instance, ensuring all protocol actions are logged.
- Improved session management by refining the handling of transfer requests, file chunks, and transfer completions.
- Enhanced error handling and logging for better debugging and user feedback during file transfers.
- Refactored code for clarity and maintainability, ensuring consistent logging practices throughout the protocol.

These changes aim to improve the reliability and traceability of file transfer operations within the networking module.
2025-07-11 16:01:44 -07:00
Jamie Pine
a5c3f72358 Refactor networking module to transition from libp2p to Iroh P2P
- Replaced libp2p dependencies with Iroh for peer-to-peer networking, enhancing NAT traversal and simplifying the architecture.
- Updated Cargo.toml to include Iroh dependencies and removed libp2p-related configurations.
- Refactored networking documentation to reflect the new Iroh-based architecture, emphasizing improved device discovery and connection management.
- Modified event loop and protocol handlers to utilize Iroh's stream-based communication model.
- Removed legacy libp2p components, including the unified behavior and discovery modules, streamlining the codebase.

These changes aim to improve networking reliability and performance while simplifying the overall structure of the Spacedrive networking module.
2025-07-11 15:52:35 -07:00
Jamie Pine
c242af391c Merge pull request #1 from jamiepine/cli
Implement structured CLI output system
2025-07-11 15:04:03 -07:00
Jamie Pine
ce474427b6 Implement structured CLI output system
Replace println\! calls across all CLI domains with a type-safe, testable output system supporting multiple formats (Human, JSON, Quiet), verbosity levels, and consistent styling.

• Add new output module with CliOutput wrapper and Message enum
• Implement HumanFormatter with colors/emojis and JsonFormatter
• Create OutputSection builder for complex multi-line outputs
• Add comprehensive test suite for output system
• Update CLI argument parsing for new output options
• Migrate all domain handlers: daemon, library, location, job, network, file, system
• Replace all println\! with structured output.print(Message::...) calls
• Add dependencies: owo-colors, supports-color

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-11 15:02:54 -07:00
Jamie Pine
c4ddf3b4ae Refactor CLI output system for improved structure and consistency
- Updated the documentation to propose a refactoring of the CLI output system, replacing `println!` with a more structured approach using existing Rust libraries.
- Introduced recommended libraries for terminal UI, CLI output, structured output, and progress indication.
- Implemented a lightweight wrapper around these libraries to enhance output formatting and user experience.
- Added a fluent builder API for complex multi-line outputs, improving code clarity and maintainability.
- Established a phased implementation checklist for gradual migration and feature enhancements.

These changes aim to streamline CLI output management, enhance user feedback, and improve overall code organization.
2025-07-11 13:40:14 -07:00
Jamie Pine
ba180c2329 Refactor CLI command structure and remove networking commands module
- Removed the `networking_commands` module to streamline command handling.
- Introduced new commands for starting, stopping, and checking the status of the Spacedrive daemon.
- Updated the CLI command parsing and execution logic to accommodate the new command structure.
- Enhanced user feedback for starting and stopping the daemon, ensuring clarity in command usage.
- Improved overall organization and maintainability of the CLI codebase.

These changes simplify the CLI interface and improve the user experience by providing clearer command definitions and feedback.
2025-07-11 13:32:32 -07:00
Jamie Pine
3395458b40 Refactor CLI to domain-driven architecture
- Split monolithic commands.rs into separate domain modules
- Add domains/ directory with dedicated modules for each functional area:
  - daemon: Daemon lifecycle and indexing operations
  - file: File operations (copy, scanning)
  - job: Job management and monitoring
  - library: Library management operations
  - location: Location management
  - network: Network and device operations
  - system: System monitoring
- Enhanced daemon module with new indexing commands (QuickScan, Browse)
- Improved code organization and maintainability
- Preserve existing CLI interface while improving internal structure

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-11 15:16:39 -04:00
Jamie Pine
724a55885a Remove CLI application logic and refactor command definitions
- Deleted the `app.rs` file, which contained the main CLI application logic.
- Updated `commands.rs` to streamline command definitions and improve clarity.
- Enhanced the structure of command enums for better usability and maintainability.
- Refactored related modules to ensure consistency in command handling and improve overall code organization.

These changes simplify the CLI architecture, making it easier to manage commands and improve user experience.
2025-07-10 16:56:06 -07:00
Jamie Pine
9ca4971a2f Remove monitor module and enhance event structure for job progress
- Deleted the `monitor.rs` file, which provided a CLI job monitoring interface.
- Updated the `Event` enum in `events/mod.rs` to include `job_type` and `generic_progress` fields in the `JobProgress` event, allowing for more detailed progress reporting.
- Enhanced the `JobManager` to emit enriched job progress events, incorporating structured progress data for better tracking and user feedback.
- Introduced a new `CopyDatabaseQuery` module to support instant size and file count estimates for copy operations, improving overall performance and user experience.
2025-07-10 16:56:01 -07:00
Jamie Pine
4f1dc60354 Revise IROH migration design document to include detailed implementation plan
- Expanded the implementation plan to provide a comprehensive, phased approach for migrating from libp2p to Iroh, detailing each phase's objectives and tasks.
- Clarified the structure of the NetworkingService and the transition to Iroh's Endpoint, emphasizing the simplification of the event loop and removal of libp2p-specific files.
- Updated protocol definitions and device management to align with Iroh's architecture, including changes to pairing and file transfer protocols.
- Enhanced integration testing strategies to ensure compatibility with the new Iroh-based networking model, improving overall reliability and performance.
2025-07-09 21:14:00 -07:00
Jamie Pine
a25fb968fa Revise IROH migration design document to reflect updated implementation order
- Adjusted the implementation order based on feedback from Iroh founders, prioritizing endpoint migration and pairing protocol development.
- Clarified the steps for transitioning from libp2p to Iroh, emphasizing the importance of establishing a functional endpoint before proceeding with other protocols.
- Enhanced the documentation to provide a clearer roadmap for the migration process, ensuring better alignment with project goals and user needs.
2025-07-09 20:55:29 -07:00
Jamie Pine
b6f94c5b36 Add Iroh migration design document for Spacedrive networking
- Introduced a comprehensive design document detailing the migration from libp2p to Iroh for Spacedrive's networking module.
- Outlined the benefits of Iroh, including improved NAT traversal, simpler API, and built-in QUIC transport.
- Provided a comparison of current and target architectures, along with component mapping and protocol migration strategies.
- Included an implementation plan divided into phases, addressing core infrastructure, protocol updates, testing, and relay configuration.
- Highlighted risk mitigation strategies and success metrics to ensure a smooth transition.

This document serves as a foundational guide for the upcoming migration efforts, aiming to enhance networking reliability and performance.
2025-07-09 12:40:41 -07:00
Jamie Pine
d7d1082571 Update library creation to include context and enhance copy action options
- Modified library creation calls in `indexing_demo.rs`, `library_demo.rs`, and `location_watcher_demo.rs` to include `core.context.clone()`, improving context management.
- Updated `copy_action_integration_test.rs` and `copy_action_simple_test.rs` to incorporate `copy_method: CopyMethod::Auto` in `CopyOptions`, enhancing flexibility in copy operations.
- Refactored test cases for clarity and consistency, ensuring proper setup and validation of copy actions.

These changes improve the robustness and usability of library and copy operations, providing better context handling and user control over copy methods.
2025-07-09 11:05:52 -07:00
Jamie Pine
7f0569b955 Enhance progressive copy design for improved user experience
- Introduced a phased implementation strategy for progressive copy operations, enhancing user feedback during file transfers.
- Phase 1 focuses on detailed progress reporting, including real-time estimates and preparation feedback.
- Phase 2 integrates database querying for instant startup and destination analysis to avoid redundant copies.
- Phase 3 aims for concurrent discovery, allowing simultaneous copying and file discovery for complete coverage.

These changes significantly improve the user experience by providing clear, real-time updates and optimizing the copy process.
2025-07-07 03:56:42 -07:00
Jamie Pine
91ad82fc42 Refactor CLI logging and command handling for improved clarity
- Simplified the logging setup in `run()` function to enhance readability and maintainability.
- Consolidated command handling logic for better structure and flow, ensuring unreachable commands are clearly defined.
- Updated print statements for consistency and clarity in user feedback during command execution.

These changes improve the overall user experience and maintainability of the CLI command structure.
2025-07-07 03:21:35 -07:00
Jamie Pine
0ad6b7d6fa Enhance file copy operation error handling and logging
- Improved error handling in `FileCopyJob` to provide clearer feedback during copy failures, enhancing user experience.
- Updated logging mechanisms to capture detailed error messages and operational context, aiding in debugging and monitoring.
- Refactored related components to ensure consistent error reporting across file copy operations.

These changes improve the reliability and transparency of file copy processes, making it easier for users to diagnose issues.
2025-07-06 21:40:32 -07:00
Jamie Pine
3ac07fa611 Implement copy method selection in file copy operations
- Introduced a new `CopyMethodCli` enum for CLI-specific copy method options, allowing users to specify their preferred copy method (Auto, AtomicMove, Streaming).
- Updated `FileCopyInput` to include a `copy_method` field, defaulting to `Auto`.
- Enhanced the `CopyStrategyRouter` to respect the user's copy method preference during file operations, improving flexibility and performance.
- Added tests to validate the conversion between CLI copy methods and core copy methods, ensuring correct behavior across different scenarios.

These changes enhance the file copy functionality by providing users with more control over the copy method used during operations.
2025-07-06 21:26:45 -07:00
Jamie Pine
d9d1d999c8 Enhance file copy job destination handling
- Updated destination path logic in `FileCopyJob` to differentiate between single and multiple source paths.
- Added checks to determine if the destination is a directory or a file, improving flexibility in file copy operations.
- Ensured that the destination path is correctly constructed based on the source file name when multiple sources are provided.

These changes enhance the robustness of the file copy functionality, allowing for more intuitive handling of destination paths.
2025-07-06 19:12:01 -07:00
Jamie Pine
733e46c4e4 Enhance volume management and filesystem handling
- Updated `volume_for_path` method to canonicalize paths, improving cache key accuracy and handling of relative paths.
- Enhanced logging for path canonicalization failures, ensuring better debugging information.
- Improved filesystem detection logic to skip autofs and other special filesystems, preventing unnecessary processing.
- Added validation to skip invalid size strings in volume parsing, enhancing robustness.

These changes improve the reliability and accuracy of volume management operations, ensuring better handling of filesystem interactions.
2025-07-06 18:53:34 -07:00
Jamie Pine
5aa2eecad5 Enhance job management and CLI integration with context support
- Added job_db parameter to derive_job function for improved job management.
- Refactored Core initialization to auto-load libraries with context for job manager.
- Integrated CLI state management to auto-select the first library if none is set.
- Implemented logging capabilities for daemon commands, including real-time log monitoring.
- Updated job manager to utilize context for library and service references, enhancing modularity.

These changes improve the robustness of job handling and streamline the CLI experience, ensuring better resource management and user feedback.
2025-07-06 18:26:47 -07:00
Jamie Pine
76066027c7 Fix critical copy module data integrity issues and add comprehensive documentation
## Critical Fixes Implemented

### 1. Resume Logic Fix
- Fixed broken `completed_indices` tracking in FileCopyJob
- Changed main loop to use `enumerate()` and properly skip completed files
- Added proper tracking of newly completed files during execution
- Result: Jobs now resume correctly instead of restarting from beginning

### 2. Checksum Verification Fix
- Updated `CopyStrategy` trait to accept `verify_checksum` parameter
- Implemented Blake3 checksums in `LocalStreamCopyStrategy`
- Added verification logic comparing source and destination hashes
- Added error handling that cleans up corrupted files on verification failure
- Result: Users can now enable reliable checksum verification for local copies

## Files Modified

- `src/operations/files/copy/job.rs`: Resume logic and strategy execution
- `src/operations/files/copy/strategy.rs`: Checksum verification implementation
- `src/operations/files/copy/ANALYSIS.md`: Updated status to reflect fixes
- `tests/copy_fixes_validation.rs`: Comprehensive test suite (8 tests, all passing)
- `src/operations/files/copy/RESUME_VALIDATION_DESIGN.md`: Future enhancement design

## Testing

All tests pass including:
- Resume logic validation with various scenarios
- Checksum verification success/failure cases
- Integration tests combining both fixes
- Performance tests with large file counts
- Existing copy_action_integration_test.rs (3/3 passing)

## Impact

- Eliminates data duplication/corruption from broken resume logic
- Provides reliable data integrity verification for streaming copies
- Makes copy module production-ready with proper data integrity guarantees
- Maintains backward compatibility with existing code

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-06 16:25:03 -04:00
Jamie Pine
4ec5487adc Add comprehensive analysis of copy module critical issues
Document two major data integrity flaws in the copy module:

1. Resume Logic Failure:
   - completed_indices field exists but is never used
   - Jobs always restart from beginning, causing duplicate work
   - Risk of data corruption and file conflicts on resume

2. Missing Checksum Verification:
   - verify_checksum option is ignored for streaming copies
   - Only remote transfers implement proper verification
   - Creates false security assurance for users

Includes detailed failure scenarios, impact assessment, and
implementation recommendations for fixing these critical issues.
The module is currently unsuitable for production use due to
these fundamental data integrity problems.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-06 00:24:44 -04:00
Jamie Pine
dc558615c5 Fix CLI architecture and fully integrate copy command with daemon
- Remove problematic fallback Core creation that caused library conflicts
- Add Copy command to DaemonCommand enum with full parameter support
- Implement complete copy command handler in daemon with action system integration
- Add handle_copy_daemon_command function for CLI communication
- Fix CLI argument conflict by changing copy destination from -d to -o
- Convert non-daemon commands to proper error messages instead of fallback
- Ensure all file operations go through daemon for proper resource management

This resolves the fundamental architecture issue where CLI commands
would create conflicting Core instances when daemon was running.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-05 22:24:00 -04:00
Jamie Pine
6e3b17d5e7 Fix database migration issues and add comprehensive copy action integration tests
Database Migration Fixes:
- Fix SQLite compatibility issues in audit log migration by using TEXT instead of UUID/JSON types
- Create indexes separately to avoid SQL syntax errors
- Update audit log entity model to match SQLite-compatible schema

Action Manager Improvements:
- Fix audit log finalization by properly tracking library context
- Resolve Sea-ORM active model update issue by explicitly marking changed fields
- Ensure proper string conversion for UUID and JSON fields

Integration Tests:
- Add comprehensive copy action integration tests covering full end-to-end workflow
- Test action dispatch, job execution, file operations, and audit logging
- Add validation tests and move operation tests
- Include database migration verification tests

CLI Fixes:
- Fix library creation path handling for optional PathBuf parameter

All copy action tests now pass (30/30), confirming the action system works correctly
with proper database integration and audit logging.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-05 21:08:52 -04:00
Jamie Pine
cbf4c2dcf8 Remove obsolete documentation and refactor action output handling
- Deleted the `COPY_BUILDER_USAGE.md` and `INPUT_ABSTRACTION_ARCHITECTURE.md` files as they were no longer relevant to the current architecture.
- Refactored action output handling to utilize a more structured approach, enhancing clarity and consistency across various action types.
- Updated action handlers to return detailed output messages, improving user feedback during CLI interactions.

These changes streamline the documentation and improve the overall architecture of the action management system.
2025-07-05 17:10:30 -07:00
Jamie Pine
9800ffbc35 Refactor action handling to utilize ActionOutput
- Updated action handler interfaces to return ActionOutput instead of ActionReceipt, enhancing the clarity of action results.
- Refactored ActionManager and related components to align with the new output structure, improving consistency across action executions.
- Introduced new output types for various actions, including file copy and location management, to provide more detailed feedback.
- Enhanced CLI commands to handle the updated action outputs, ensuring user interactions reflect the new structure.

These changes streamline action handling and improve the overall architecture of the codebase.
2025-07-05 16:49:11 -07:00
Jamie Pine
1d7515162d Refactor test framework module and update references
- Renamed `test_framework_new` to `test_framework` to streamline module naming.
- Updated all references in the codebase to reflect the new module name, ensuring consistency.
- Improved formatting in the `Core` struct for better readability.

These changes enhance the organization of the test framework and improve code clarity.
2025-07-05 15:57:09 -07:00
Jamie Pine
596470394d Refactor action management and module structure for improved clarity
- Moved ActionManager from `operations` to `infrastructure` to better align with its role in managing action execution.
- Updated references throughout the codebase to reflect the new module structure, enhancing clarity and maintainability.
- Introduced new action handling patterns in the CLI commands, ensuring actions are dispatched correctly with updated parameters.
- Refactored file operations to utilize the new `files` module, improving organization and reducing complexity.

These changes streamline the action management system and enhance the overall architecture of the codebase.
2025-07-04 02:52:41 -07:00
Jamie Pine
e09731ac3d Enhance CoreContext and Core initialization with ActionManager
- Added ActionManager to CoreContext for improved action handling and management.
- Updated Core initialization to create and set the ActionManager after context setup.
- Introduced helper methods in CoreContext for setting and retrieving the ActionManager.
- Removed the deprecated file sharing API and related tests to streamline the codebase.

These changes enhance the modularity and functionality of the core system, facilitating better action management and integration.
2025-07-03 17:35:24 -07:00
Jamie Pine
305426b5eb Refactor file copy operations and enhance combine_rust.sh script
- Renamed and reorganized file copy job implementation, moving from `copy_job` to `copy` for better clarity and structure.
- Updated references throughout the codebase to reflect the new module structure.
- Enhanced `combine_rust.sh` script to accept a root path argument, providing clearer usage instructions and improving flexibility in file combination.
- Added help message and default behavior for the script, ensuring better user experience and documentation.

These changes improve the maintainability of the file operations and enhance the usability of the Rust file combination script.
2025-07-02 21:17:38 -07:00
Jamie Pine
759fd35ef9 Add library leadership and key exchange protocols
- Introduced a new document detailing the design for the Sync Leadership and Key Exchange Protocols in Spacedrive Core v2.
- Implemented a user-driven Leader Promotion Model for managing sync leadership, enhancing stability and data integrity.
- Formalized the Secure Library Key Exchange Protocol, allowing devices to securely share library access and cryptographic keys.
- Updated CoreContext to include a LibraryKeyManager for managing library encryption keys.
- Refactored DeviceManager to utilize DeviceKeyManager for handling device encryption keys.
- Enhanced the Services struct to integrate the new LibraryKeyManager, improving service initialization and management.

These changes lay the groundwork for robust multi-device synchronization and secure library access in the Spacedrive system.
2025-06-29 20:01:32 -07:00
Jamie Pine
fb59e5af09 Integrate volume detection with file copy operations for intelligent routing
- Consolidate move and copy jobs with volume-aware routing
- Add atomic fs::rename for same-volume moves (preserves efficiency)
- Implement streaming copy with progress tracking for cross-volume operations
- Add volume manager integration to job system and context
- Route operations based on volume detection:
  * Same volume move → atomic rename
  * Cross-volume move → streaming copy + delete source with progress
  * Same volume copy → standard copy
  * Cross-volume copy → streaming copy with progress tracking
- Eliminate ~470 lines of duplicated logic from move_job.rs
- Provide volume-optimized chunk sizes and transfer hints
- Maintain backward compatibility with MoveJob wrapper

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-29 22:39:42 -04:00