Idea
- The cache management is currently time-based only, without considering the importance or frequency of changes
- There's no mechanism to handle cache invalidation when files are reverted or modified outside the editor
- The L1/L2 split is currently based on file paths only, without considering the semantic relationships between files
Proposed Solution
Implement a more sophisticated caching system that:
-
Introduces a weighted scoring system for changes based on:
- Frequency of edits
- Semantic relationships between files
- User interaction patterns
- Importance of the changes (e.g., critical fixes vs. minor updates)
-
Add cache invalidation triggers for:
- External file modifications
- Git reverts
- Large-scale refactoring operations
-
Implement a dynamic L1/L2 split that considers:
- File dependencies
- Change impact analysis
- User working context
Technical Details
The changes would primarily affect:
sidecar/src/agentic/tool/helpers/diff_recent_changes.rs
sidecar/src/agentic/tool/git/edited_files.rs
sidecar/src/agentic/symbol/tool_box.rs
Expected Benefits
- More efficient change tracking
- Better context preservation for AI-assisted editing
- Improved performance for large codebases
- More accurate change history for the AI to work with
Acceptance Criteria