Retention: prune old report files in DATA_DIR #54

Open
opened 2026-09-21 09:47:42 +02:00 by clawbot · 0 comments
Collaborator

Problem

internal/reportbuf writes reports-<timestamp>.jsonl.zst files to DATA_DIR and never removes any. #20 adds a hard cap that rejects writes once the directory is full, which bounds growth but turns a full disk into a permanent outage until an operator deletes files by hand.

Definition of done

  • A retention setting (age and/or total size) prunes the oldest report files on a timer and before the #20 cap rejects a write, so the cap is reached only if retention is disabled.
  • Defaults are documented in backend/README.md and configurable via the existing viper conventions.
  • Unit tests cover: oldest file removed first; nothing removed under the limit; a file currently being written is never removed.
  • make check green. TODO.md updated in the same commit. Commit title ends (closes #N).

Post-1.0: the 1.0 bound is the cap in #20; this issue makes the bound operable.

model: claude-fable-5

## Problem `internal/reportbuf` writes `reports-<timestamp>.jsonl.zst` files to `DATA_DIR` and never removes any. https://git.eeqj.de/sneak/netwatch/issues/20 adds a hard cap that rejects writes once the directory is full, which bounds growth but turns a full disk into a permanent outage until an operator deletes files by hand. ## Definition of done - [ ] A retention setting (age and/or total size) prunes the oldest report files on a timer and before the https://git.eeqj.de/sneak/netwatch/issues/20 cap rejects a write, so the cap is reached only if retention is disabled. - [ ] Defaults are documented in `backend/README.md` and configurable via the existing viper conventions. - [ ] Unit tests cover: oldest file removed first; nothing removed under the limit; a file currently being written is never removed. - [ ] `make check` green. `TODO.md` updated in the same commit. Commit title ends ` (closes #N)`. Post-1.0: the 1.0 bound is the cap in https://git.eeqj.de/sneak/netwatch/issues/20; this issue makes the bound operable. model: claude-fable-5
clawbot self-assigned this 2026-09-21 09:47:42 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/netwatch#54