How lbg2002/ai-file-sorter works
FileSort Guard is a Qt file-organization application whose central workflow scans a selected folder, proposes categories in AI or deterministic rule mode, validates the plan against the scan, and presents it for approval before changes are applied. The graph also preserves prompt editing, document/image analysis, storage-provider support, and undo/history. The README documents the main workflow; sampled source confirms selected storage, local-LLM, and headless-apply responsibilities, but not every runtime connection.
Main entry points: AnalysisCoordinator.cpp Analysis coordinator · CategorizationService.cpp AI categorization · HeadlessReviewApplyService.cpp Apply changes · StorageProvider.hpp Storage provider
Components 22
Organization workflow
- Analysis coordinator
app/lib/AnalysisCoordinator.cpp - Filesystem scan
app/lib/FileScanner.cpp - Apply changes
app/lib/HeadlessReviewApplyService.cpp
Analysis and prompts
- AI categorization
app/lib/CategorizationService.cpp - Rule mode
app/lib/RuleEngine.cpp - Prompt editor
app/lib/PromptEditorDialog.cpp - Prompt templates
app/lib/PromptTemplateStore.cpp - LLM clients
app/lib/LLMClient.cpp - Local LLM runtime
app/lib/LocalLLMClient.cpp - Document analysis
app/lib/DocumentTextAnalyzer.cpp - Image analysis
app/lib/ImageAnalyzerFactory.cpp
Review and state
- Plan integrity check
app/lib/ResultIntegrityValidator.cpp - Review and approval
app/lib/ResultsCoordinator.cpp - Undo history
app/lib/UndoManager.cpp - Review history
app/lib/ReviewHistoryStore.cpp - Categorization cache
app/lib/DatabaseManager.cpp
Storage integrations
- Storage provider
app/include/StorageProvider.hpp - OneDrive provider
app/lib/OneDriveStorageProvider.cpp - Storage plugin manager
app/lib/StoragePluginManager.cpp
Application interface
- Qt application
app/main.cpp - Main window
app/lib/MainApp.cpp
Other components
- User
Connections 21
- User → Qt application: starts
app/main.cpp - Qt application → Main window: opens
- Main window → Analysis coordinator: starts analysis
- Analysis coordinator → Filesystem scan: scans
- Analysis coordinator → AI categorization: requests AI plan
- Analysis coordinator → Rule mode: selects rule mode
- AI categorization → LLM clients: categorizes
- LLM clients → Local LLM runtime: uses local backend
- Prompt editor → Prompt templates: edits templates
- Prompt templates → AI categorization: provides override
- AI categorization → Document analysis: analyzes documents
- AI categorization → Image analysis: analyzes images
- Analysis coordinator → Plan integrity check: validates plan
- Plan integrity check → Review and approval: flags anomalies
- Review and approval → Apply changes: approves changes
- Apply changes → Storage provider: moves files
app/lib/HeadlessReviewApplyService.cpp - Apply changes → Categorization cache: updates cache
app/lib/HeadlessReviewApplyService.cpp - Apply changes → Review history: records moves
app/lib/HeadlessReviewApplyService.cpp - Undo history → Review history: uses history
- OneDrive provider → Storage provider: implements provider
- Storage plugin manager → Storage provider: loads providers