Skip to main content

Continuous Storage Janitor technical architecture

Status​

This architecture is IMPLEMENTED. The Continuous Storage Janitor is deployed and enabled on services-node-01. The emergency control-plane storage-pressure guard remains active as an independent fail-closed safety layer.

Canonical Project Bootstrap revision: d201a49a095fb89a49aef76f9bc59a44f92f7d9f. Final validation included restart acceptance, a live read-only canary, green-state convergence, lifecycle-safe reclaim, database/WAL telemetry, and non-destructive reporting of UNCLASSIFIED storage.

Purpose​

ARSGATE must reclaim obsolete operational data continuously while the platform is healthy. Cleanup is driven by lifecycle proof, not by low-disk pressure.

Components​

The target architecture contains a persistent low-priority arsgate-storage-janitor, a Lifecycle Registry, filesystem collectors, database-maintenance adapters, a green-state controller, telemetry and an unknown-data remediation lane. The existing storage-pressure guard remains independent as the final fail-closed airbag.

Lifecycle classes​

  • ACTIVE — required by a live job, lease, workstream, runtime or canonical operation. Never delete.
  • DURABLE_EVIDENCE — receipts/audit required for governance. Retain according to policy.
  • RECLAIMABLE — authority proves the object is no longer required. Remove continuously.
  • COLD_HISTORY — historical evidence no longer needed in the hot operational store. Archive/offload according to policy.
  • UNCLASSIFIED — ownership/lifecycle cannot be proven. Never auto-delete; emit UNCLASSIFIED_STORAGE.

Filesystem behavior​

Terminal transitions should expose reclaim eligibility immediately. The Janitor consumes that proof and invokes existing typed privileged cleanup routes. A periodic reconciliation sweep catches missed events. Remote-operation payloads, terminal worktrees, pinned integration artifacts, stale temporary files and declared caches become candidates only after their safety contract passes.

Database behavior​

Database maintenance is adapter-specific. For authority.db, the design extends the existing authority-maintain path: event/history retention is archive-first, WAL checkpoint/truncate is policy-driven, fragmentation is measured, and physical compaction runs only through an approved safe operation. The Janitor never issues ad-hoc destructive SQL.

Green state versus emergency state​

The Janitor maintains a configurable desired free-space target. Initial acceptance will evaluate a 20–25 GiB target on services-node-01; the exact production value remains an implementation decision based on live capacity.

The existing storage guard remains separate: preventive reclaim currently begins around the configured 12 GiB / 12% rule; the current hard floor is approximately 8 GiB / 8% plus inode protection. Normal operation should remain well above those boundaries.

Scheduling and safety​

Cleanup runs continuously at low CPU/I/O priority. Each pass is bounded, but further passes continue until the green target and backlog objectives are met. ACTIVE objects are never deleted. Unknown objects are reported, not guessed. Cleanup remains typed, privileged, idempotent and fail-closed.

Acceptance​

BOOT-024/025 must prove steady state, not a one-time cleanup: normal workload creates active and terminal artifacts; terminal objects disappear while active objects remain; filesystem and database usage stabilize instead of growing monotonically.