local cache taask completed#327
Open
MoscowDev wants to merge 1 commit into
Open
Conversation
codeZe-us
self-requested a review
July 16, 2026 22:36
codeZe-us
approved these changes
Jul 16, 2026
Contributor
|
@MoscowDev please resolve workflow issues |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Task Completion Summary
Successfully redesigned and enhanced the
CacheStoremodule to implement a robust, directory-aware cache management system with automatic storage enforcement and eviction.Summary of Work Completed
The caching mechanism was refactored to eliminate the previous limitation where only the size of an individual file was validated before being written. The new implementation now continuously monitors the aggregate size of the entire cache directory, ensuring that the configured cache limit is always respected.
A Least Recently Used (LRU) eviction policy was introduced to intelligently manage cached artifacts. Before persisting any new cache entry, the system calculates the total disk usage of the cache directory. If adding the new artifact would exceed the configured maximum cache size (512 MB by default), the cache automatically identifies the least recently accessed files by inspecting filesystem access timestamps and removes the oldest entries until sufficient storage space is reclaimed.
The cache lifecycle is now fully automated, requiring no manual intervention. The implementation also improves overall performance by retaining frequently accessed artifacts while safely pruning stale data, reducing unnecessary network requests without allowing uncontrolled disk growth.
Key Improvements
CacheStoreto support directory-level cache size management.Files Modified
crates/core/src/cache/store.rsOutcome
The caching subsystem is now self-managing, storage-bounded, and production-ready. Regardless of how extensively Grat is used, the cache directory remains strictly within its configured storage limit, automatically evicting stale entries using an efficient LRU strategy. This enhancement prevents filesystem exhaustion, improves cache efficiency, and ensures predictable resource utilization across local development and automated build environments.
closes #303