RetentionSweep
Corex\Config\Retention\RetentionSweep · class · Config layer
The unified retention sweep (spec 068 T202): given the registered {@see PrunableStore}s (activity, captured email, consent, export logs, …), it previews or applies pruning for each. Each store’s cutoff is derived from its own configured window; a window of 0 means keep-forever and the store is skipped, never pruned. preview() reports the plan without deleting; apply() performs the deletions and reports what was removed. The store list is injected, so this is unit-testable with in-memory fakes.
Public API
Section titled “Public API”__construct(array $stores)
Section titled “__construct(array $stores)”preview(): array
Section titled “preview(): array”A non-destructive plan: for each store, its label, window, and whether it is enabled (window > 0).
apply(DateTimeImmutable $now): array
Section titled “apply(DateTimeImmutable $now): array”Prune every enabled store older than its own window relative to $now, returning the removed count per store and the total. Stores with a zero window are skipped (never pruned).