A metadata write is destructive by construction (ADR 0003): the body we send becomes the item’s state. A wrong mapping — a bad Last.fm match, an over-eager tag policy — would otherwise overwrite curated genres, tags and overviews with no way back.
Before every write, persist an immutable snapshot of the item’s current
WRITABLE_FIELDS values, plus the Etag and DateLastSaved observed at read
time. Revert is a normal write built from the snapshot’s fields, and is itself
recorded as a new audit row.
Snapshots are never mutated or deleted. source_op distinguishes
apply / revert / bulk_apply, and batch_id groups a bulk operation so a
whole run can be rolled back.
audit_log with the
lastfm_request_ids that justified it, so provenance is traceable from a
written value back to the archived response it came from.