chore: capture post-P0/P1 state for clean P2 start (working tree was dirty at task begin)

This commit is contained in:
2026-05-27 00:53:49 -05:00
parent 9cb38a9a18
commit 0c1840d223
17 changed files with 1500 additions and 170 deletions
+18 -7
View File
@@ -76,17 +76,28 @@ func EvictSmallest(v vfs.VFS, bytesNeeded uint) uint {
return EvictBySizeAsc(v, bytesNeeded)
}
// EvictLFU performs LFU (Least Frequently Used) eviction
// EvictLFU performs LFU (Least Frequently Used) eviction using AccessCount from FileInfo (P1-03 real impl).
func EvictLFU(v vfs.VFS, bytesNeeded uint) uint {
// For now, fall back to size-based eviction
// TODO: Implement proper LFU tracking
return EvictBySizeAsc(v, bytesNeeded)
switch fs := v.(type) {
case *memory.MemoryFS:
return fs.EvictLFU(bytesNeeded)
case *disk.DiskFS:
return fs.EvictLFU(bytesNeeded)
default:
return 0
}
}
// EvictHybrid implements a hybrid eviction strategy
// EvictHybrid implements a documented size+recency+frequency hybrid (uses GetTimeDecayedScore; lower=evict first).
func EvictHybrid(v vfs.VFS, bytesNeeded uint) uint {
// Use LRU as primary strategy, but consider size as tiebreaker
return EvictLRU(v, bytesNeeded)
switch fs := v.(type) {
case *memory.MemoryFS:
return fs.EvictHybrid(bytesNeeded)
case *disk.DiskFS:
return fs.EvictHybrid(bytesNeeded)
default:
return 0
}
}
// GetEvictionFunction returns the eviction function for the given strategy