metaedit

0011. Measure the ToS cap; never silently delete archive data

Context

The Last.fm API Terms of Service define a “Reasonable Usage Cap” of 100 MB of stored Last.fm Data, and require aggressive caching. A tool that keeps a permanent archive is therefore obliged to keep that number in view.

Decision

Measure stored payload bytes continuously (archive_stat, plus an /api/archive/stats endpoint and a metaedit archive-stats command). Warn at 80 % (ARCHIVE_WARN_RATIO). At 100 % refuse to store new distinct payloads and return 507 archive_cap_reached with the exact byte count and the remedy.

Never delete automatically. Deleting archive history is only ever an explicit operator action (metaedit prune-raw --keep-days N, which reports what it would drop and requires --yes).

Repeat observations of an already-stored body are always allowed, because they cost no new payload bytes.

Consequences

Alternatives rejected