NAME
Developer::Dashboard::Housekeeper - cleanup stale dashboard temp state
SYNOPSIS
use Developer::Dashboard::Housekeeper;
my $housekeeper = Developer::Dashboard::Housekeeper->new( paths => $paths );
my $summary = $housekeeper->run;
DESCRIPTION
This module removes stale dashboard-owned temp artefacts from the shared temp area. It currently targets hashed runtime state roots under /tmp/<user>/developer-dashboard/state/, oversized Ajax payload temp files created under /tmp/, file-backed runtime result payloads created under /tmp/dashboard-result-*, and configured collector log transcripts that exceed their declared retention windows.
PURPOSE
This module is the cleanup service for dashboard-owned temp artefacts. It keeps the shared temp state area from filling up with dead runtime roots and removes leftover oversized Ajax payload files plus stale runtime result temp files once they are old enough to be considered abandoned. It also enforces configured collector log retention through the same built-in housekeeper path.
WHY IT EXISTS
It exists because state was intentionally moved out of the persistent runtime tree and into /tmp/ so reboot cleanup could discard stale state safely. Without a runtime-owned cleanup pass, repeated project-layer work and test runs can still accumulate dead hashed state directories and orphaned temp payload files between reboots, while collector transcript logs can also grow without a separate retention pass.
WHEN TO USE
Use this file when changing temp-state layout, stale-state retention rules, or the built-in cleanup command and collector that keep the shared temp area tidy, including collector log rotation policy.
HOW TO USE
Construct it with the active path registry, then call run. The result is a hash reference that reports what was scanned and what was removed. Collector definitions can add rotation or rotations with lines, minutes/minute, hours/hour, days/day, weeks/week, and months/month retention values for housekeeper-managed transcript rotation.
WHAT USES IT
It is used by the built-in dashboard housekeeper command and by the built-in housekeeper collector job that runs through the normal collector runtime.
EXAMPLES
Example 1:
perl -Ilib -MDeveloper::Dashboard::Housekeeper -e 1
Compile-load the module directly from a source checkout.
Example 2:
dashboard housekeeper
Run the built-in command path and print the JSON cleanup summary.
Example 3:
dashboard collector run housekeeper
Run the built-in housekeeper collector through the collector runtime and store its output like any other managed collector.
Example 4:
prove -lv t/05-cli-smoke.t t/07-core-units.t
Recheck the focused CLI and unit regressions that cover this cleanup module and its built-in command surface.