Files
keep/DESIGN.md
Andrew Phillips e51a902660 refactor: integrate digest functionality into meta plugins and remove digest_engine module
Co-authored-by: aider (openai/andrew.openrouter.qwen.qwen3-coder) <aider@aider.chat>
2025-07-28 17:31:23 -03:00

63 lines
2.4 KiB
Markdown

# PROJECT RULES - KEEP FIRST
## Standard Rules
1. ALWAYS keep DESIGN.md updated with any architectural or design changes
2. ALWAYS keep project rules first in this document
3. ALWAYS use git commands to remove or move files (`git rm`, `git mv`, etc.)
4. Follow Rust naming conventions and idioms
5. Use anyhow for error handling throughout the codebase
6. Maintain comprehensive logging with the log crate
7. Write unit tests for critical functionality
8. Document public APIs with rustdoc comments
9. Keep modules focused on single responsibilities
10. Prefer composition over inheritance
11. Handle errors gracefully and provide meaningful error messages
12. Ensure code is safe and avoids unsafe blocks where possible
## Code - Modules
### Main Module
- `main.rs` - Entry point, CLI argument parsing, mode dispatching
- Interacts with all mode modules based on user input
- Handles database connection setup and data directory management
### Mode Modules
- `modes/save.rs` - Save new items with tags/metadata
- `modes/get.rs` - Retrieve items by ID/tags
- `modes/list.rs` - List items with filtering and formatting
- `modes/delete.rs` - Delete items by ID
- `modes/update.rs` - Update item tags/metadata
- `modes/info.rs` - Show detailed item information
- `modes/diff.rs` - Compare two items
- `modes/status.rs` - Show system status and capabilities
- `modes/common.rs` - Shared utilities for all modes
### Database Module
- `db.rs` - SQLite database operations
- Handles items, tags, and metadata storage
- Provides query functions for all modes
- Manages database migrations
### Compression Engine Module
- `compression_engine.rs` - Trait and type definitions
- `compression_engine/gzip.rs` - GZip implementation
- `compression_engine/lz4.rs` - LZ4 implementation
- `compression_engine/none.rs` - No compression implementation
- `compression_engine/program.rs` - External program wrapper
### Digest Functionality
- Digest functionality is now integrated into meta plugins
- SHA-256 and other digest algorithms are implemented as meta plugins
- External digest programs are supported through meta plugin program wrapper
### Meta Plugin Module
- `meta_plugin.rs` - Trait and type definitions
- `meta_plugin/program.rs` - External program wrapper
- `meta_plugin/digest.rs` - Internal digest implementations
### Plugins Module
- `plugins.rs` - Shared plugin utilities
- Contains `ProgramWriter` for external process communication