Documentation
¶
Overview ¶
Package maintenance provides periodic storage hygiene for the odek home directory (~/.odek): session retention, audit-record retention, log rotation, Telegram plan/media cleanup, and skill skip-list garbage collection.
The janitor is safe to run concurrently with a live agent: every pass is idempotent, individual steps are independent (one failing step does not abort the rest), and deletions are based on file modification times.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Start ¶
Start runs Sweep on an interval until ctx is cancelled. It launches a background janitor goroutine and returns immediately. The first sweep runs after one interval (not immediately, so process startup isn't slowed). A disabled config or non-positive interval is a no-op / falls back to the default interval respectively.
Types ¶
type Config ¶
type Config struct {
Enabled bool
IntervalMinutes int // janitor tick; default 60
SessionsMaxAgeDays int // delete sessions older than this; default 30; 0 = keep forever
AuditMaxAgeDays int // delete audit records older than this; default 14; 0 = keep
LogMaxMB int64 // rotate telegram/schedule logs larger than this; default 50; 0 = no rotation
PlansMaxAgeDays int // delete telegram plans older than this; default 30; 0 = keep
SkillsSkipMaxAgeDays int // GC skill skip-list entries older than this; default 90; 0 = keep
}
Config controls the storage-maintenance janitor.
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns the out-of-the-box maintenance policy.
type Report ¶
type Report struct {
SessionsRemoved int
AuditRemoved int
PlansRemoved int
SkipsRemoved int
MediaFreedBytes int64
LogsRotated []string
}
Report summarises what one Sweep pass removed.