docs: ADR-0006 §8 step 8 — mark undo/snapshot implemented

- requirements.md U1/U2: [ ] -> [x] with implementation notes
- CLAUDE.md Safety bullet: implemented; drop U-series from the
  deliberately-deferred list
- ADR-0006 Amendment 1: "not yet implemented" -> implemented, plus an
  Implementation note (index.yaml, source-gated snapshots, non-fatal
  snapshot-failure policy, batch primitive, testing + accepted gaps)
- ADR README index: undo/snapshot half marked implemented
This commit is contained in:
claude@clouddev1
2026-05-24 20:58:31 +00:00
parent cf53023a71
commit 5442cfc0b9
4 changed files with 54 additions and 15 deletions
+12 -7
View File
@@ -365,7 +365,7 @@ handoff-14 cleanup; 449 after B2/C2.)
## Undo and replay (per ADR-0006)
- [ ] **U1** Auto-snapshot before **every** data/schema mutation
- [x] **U1** Auto-snapshot before **every** data/schema mutation
(DSL + SQL) into a persisted ring buffer (size N=50, tunable),
per ADR-0006 Amendment 1 (single-step undo, superseding the
original destructive-only model). Snapshot is a hybrid
@@ -374,14 +374,19 @@ handoff-14 cleanup; 449 after B2/C2.)
finalised after the db commit (preserves ADR-0015 §6). A batch
command (`replay` / future batch ops) records one boundary
snapshot; `import` takes none. A `--no-undo` CLI flag disables
snapshotting. *(Designed + amended + planned in
`docs/plans/20260524-adr-0006-undo-snapshots.md`; not yet
implemented.)*
- [ ] **U2** `undo` restores the most recent snapshot (database +
snapshotting. *(Implemented 2026-05-24, plan
`docs/plans/20260524-adr-0006-undo-snapshots.md`: `src/undo.rs`
ring + worker dispatch hook in `src/db.rs`; snapshots gated on a
user command `source` so internal ops like open-time rebuild are
not recorded; snapshot-bookkeeping failures are non-fatal, restore
failures surface.)*
- [x] **U2** `undo` restores the most recent snapshot (database +
text, directly); `redo` re-applies (redo stack discarded on new
work); both prompt for confirmation naming the command being
undone / re-applied (`Y` confirms). *(Designed + amended; not yet
implemented — see U1's plan.)*
undone / re-applied (`Y` confirms). *(Implemented 2026-05-24:
`undo` / `redo` app commands, `Modal::UndoConfirm`, runtime
prepare→confirm→restore→refresh; `--no-undo` reports undo is off,
empty stacks report "nothing to undo/redo".)*
- [x] **U3** `history.log` records every submitted command in
append-only form, tagged with its outcome (Iteration 2;
broadened by ADR-0034). Format: `<ISO-8601 Z>|<status>|<source>`