Wire disk-pressure self-heal into the Tentacle host lifecycle
Summary
- The self-heal scaffolding (
SelfHealController,DiskPressureHealAction,DefaultWorkspaceCleanupPolicy— all with tests) was built but never scheduled:TentacleFlavorreturnedBackgroundTasks = [], so a disk-full agent failed every deployment viaLocalScriptService's admission gate with no auto-reclaim of completed-script workspaces (SOTA-audit P2 'wired-but-dead code'). - New
WorkspaceProbe: enumerates{tempRoot}/squid-tentacle-{ticketId}dirs and classifies each from its persistedScriptState(Complete+0 → Succeeded, Complete+nonzero → Failed, started-not-complete → Active, none → Unknown) + recursive size + last-write. - New
SelfHealBackgroundTask: adaptsSelfHealControllerto the hostITentacleBackgroundTasklifecycle (start on launch, drain on shutdown);ForLocalWorkspacesbuilds the disk-pressure action over the temp root with the running script backend as the live-workspace veto (an in-flight deployment's workspace is never swept). -
TentacleFlavornow schedules it. Reclaim happens only under disk pressure and only on completed/orphaned workspaces, keeping a per-status retention window for post-mortem.
Test plan
-
Unit: WorkspaceProbeTests(real temp dirs + realScriptStatefiles — status matrix, prefix filter, size, missing-root);SelfHealBackgroundTaskTests(RunAsync starts the loop + drains on cancel);TentacleFlavorSelfHealWiringTests(the flavor schedules a SelfHeal task — dead-code-is-live guard) — all green -
Existing scaffolding tests (policy/action/controller) unchanged + green -
Full solution builds clean; non-breaking (additive background task; veto protects running scripts) -
Note: the real-script LocalScriptServiceTestscan't run on the author's local machine (disk 98% full trips LocalScriptService's own admission gate — proven pre-existing by stashing this change); CI runs them on free disk