Add a guarded early-eviction tier for large verified cache copies #15
Loading…
Reference in a new issue
No description provided.
Delete branch "oss-oo/cache-policy-rt20261009"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What this changes
A conservative early-eviction tier for large verified cache copies (owner
decision "A", 2026-10-09): verified CLEAN cache copies at or above 1 GiB age
out after a configurable short window (default 2 h) instead of waiting the
full 24 h cache-max-age. Small files keep the 24 h default.
pdrive-cache-agehelper family (noparallel evictor): a second, shorter age tier that applies only to files
at or above the fixed 1 GiB threshold AND verified clean — never dirty,
pending, uploading, error or conflict-flagged. In-use protection via the
existing activity clocks; when in doubt the helper skips (fail-safe =
keep). Works on the cache directory only — mount options and the cache
fingerprint are untouched.
systemd/user/pdrive-cache-evict.timer(15 min,draft-recovery timer pattern) drives the guarded auto path; it is
authorized by the saved preference and a no-op when the preference is off
(double no-op at the 24 h choice). Carried by the installer (glob install
verified cache copies: Keep 1 h / 2 h / 6 h / 24 h (default 2 h)",
persisted in
pdrive-cache.conf(single source of truth alongside thehelper grammar), Apply/Save sensitivity per contract, activation on the
next timer tick; running transfers unaffected. Threshold fixed at 1 GiB,
documented as such.
pdrive-statereports the tier (additive schema) and theControl Center cache card tooltip mentions the policy short form; no new
cards or graphs.
docs/OPERATIONS.mdgains the full settings reference entry(access path, choices + default, persistence, activation timing, safety
impact) and the cache section notes the tier; the TROUBLESHOOTING
disk-usage expectation now mentions the early tier.
Evidence
invariants, timer pattern, preference row, state/UI surfacing, installer
coverage, docs, tests + gates, spec sweep). The two doc findings (wrong
command example, stale TROUBLESHOOTING expectation) are fixed in this
branch (
1c2a181); the formatting finding is fixed at source (0c0ec49,prettier 3.5.3).
cleanly onto fresh
main(8714697, v0.9.5) — git auto-skipped thealready-merged base; the 5 round commits replayed without conflicts.
make checkgreen on the rebased tree (twice, incl. after theformatting commit);
git diff --checkclean; changed Markdown passesprettier@3.5.3 --check.tests/test-cache-evict.sh(243 lines: threshold boundary,clean-only enforcement, in-use skip, policy-off no-op, tier arithmetic,
timer enable/disable) plus cache-age, state, systemd, preferences and
widget extensions.
Non-blocking findings (recorded; from the validation dossier)
atime/mtime) with a small read-metadata→unlink race (TOCTOU): within the
spec's "existing helper heuristics" allowance; the worst case is a
re-download of provably clean data, never loss of dirty state.
fail together in scenario D) and no dedicated 1 h-choice scenario — same
code path as covered scenarios (shared
rc()helper, same grammar).CI fix (run 40)
The first CI run failed in the new eviction test: its unreadable-policy leg
used a mode-0000 config file, which the CI container's root user can still
read (locally the checks run as a normal user). The leg now makes the config
path a directory, so the read fails with OSError for every user — the tested
invariant (unreadable policy ⇒ nothing is evicted) is unchanged.
make checkgreen on the fixed tree.