beads/website/versioned_docs
matt wilkie 889ade6b7f
fix(compact): archive content before destructive compaction; make restore work (#4464)
Content compaction (bd admin compact) overwrote an issue's description and
cleared design/notes/acceptance_criteria in place with no archive, while the
issue_snapshots/compaction_snapshots tables built to hold that archive were
dead code (never written). The only recovery, bd restore, was display-only and
relied on a largest-history-row heuristic that dolt gc / history-squash can
erase. Net: compaction was effectively irreversible.

Wire the existing compaction_snapshots table: archive the full pre-compaction
content (snapshot_json BLOB) before the destructive overwrite, aborting if the
archive fails; add SnapshotIssue/GetCompactionSnapshot/RestoreFromSnapshot to
the CompactionStore interface on both Dolt and embedded stores; and rework
bd restore to restore from the snapshot (--apply writes it back; default stays
read-only display, with the old Dolt-history reconstruction as fallback).

Unit tests assert snapshot-before-overwrite ordering and abort-on-archive-
failure; an integration test covers the snapshot -> overwrite -> restore round
trip against a real Dolt store. CLI reference docs regenerated for the new flag.

Refs #4463

Agent-Signature: claude-opus-4-8-high on behalf of maphew
2026-06-20 14:12:07 -07:00
..
version-1.0.0 fix(compact): archive content before destructive compaction; make restore work (#4464) 2026-06-20 14:12:07 -07:00
version-1.0.4 fix(compact): archive content before destructive compaction; make restore work (#4464) 2026-06-20 14:12:07 -07:00
version-1.0.5 fix(compact): archive content before destructive compaction; make restore work (#4464) 2026-06-20 14:12:07 -07:00