Classes
CacheValidator
Validates build cache integrity (essential checks only).
Checks:
- Cache file exists and is readab…
CacheValidator
Validates build cache integrity (essential checks only).
Checks:
- Cache file exists and is readable
- Cache format is valid JSON
- Cache size is reasonable (not corrupted/bloated)
- Has expected structure (file_hashes, dependencies)
Skips:
- Deep dependency graph validation (complex)
- File hash verification (too slow)
- Advanced corruption detection (overkill)
Inherits from
BaseValidatorMethods 1
validate
Run cache validation checks.
validate
def validate(self, site: Site, build_context: BuildContext | Any | None = None) -> list[CheckResult]
Run cache validation checks.
Parameters 2
site |
Site |
|
build_context |
BuildContext | Any | None |
Returns
list[CheckResult]
Internal Methods 4
_check_cache_readable
Check if cache file is readable and valid JSON.
_check_cache_readable
def _check_cache_readable(self, cache_path: Path) -> tuple[bool, dict[str, Any]]
Check if cache file is readable and valid JSON.
Parameters 1
cache_path |
Path |
Returns
tuple[bool, dict[str, Any]]
_check_cache_structure
Check if cache has expected structure.
_check_cache_structure
def _check_cache_structure(self, cache_data: dict[str, Any]) -> tuple[bool, list[str]]
Check if cache has expected structure.
Parameters 1
cache_data |
dict[str, Any] |
Returns
tuple[bool, list[str]]
_check_cache_size
Check if cache size is reasonable.
_check_cache_size
def _check_cache_size(self, cache_path: Path, cache_data: dict[str, Any]) -> list[CheckResult]
Check if cache size is reasonable.
Parameters 2
cache_path |
Path |
|
cache_data |
dict[str, Any] |
Returns
list[CheckResult]
_check_dependencies
Check basic dependency tracking.
_check_dependencies
def _check_dependencies(self, cache_data: dict[str, Any]) -> list[CheckResult]
Check basic dependency tracking.
Parameters 1
cache_data |
dict[str, Any] |
Returns
list[CheckResult]