No schema/bucket changes. One new configuration field; the activity record and bucket are unchanged.
| Field | Type | JSON / mapstructure | Default | Meaning |
|---|---|---|---|---|
ActivityMaxSizeMB |
int |
activity_max_size_mb / activity-max-size-mb |
256 |
Max total stored size of the activity log in MB. 0 (or negative) disables size-based pruning. Applied alongside ActivityRetentionDays and ActivityMaxRecords. |
Lives next to the existing activity settings in internal/config/config.go:
ActivityRetentionDays, ActivityMaxRecords, ActivityMaxResponseSize, ActivityCleanupIntervalMin.
- ActivityRecord (
internal/storage/activity_models.go):ID(ULID),Timestamp, type, payload fields. Stored in bucketactivity_recordsunder keyactivityKey(timestamp, id)— timestamp-ordered ascending. - Activity log: the
activity_recordsbucket.
- Bucket data size = Σ
len(key)+len(value)overactivity_records. Computed transiently during pruning; not persisted.
Applied in order each cleanup cycle:
- Age cap —
PruneOldActivities(maxAge)(existing) - Count cap —
PruneExcessActivities(maxRecords, 0.9)(existing) - Size cap —
PruneActivitiesToSize(maxBytes)(new) —maxBytes = ActivityMaxSizeMB * 1024 * 1024; skipped when≤ 0.