mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-16 09:39:39 +02:00
Each iteration bucket now carries a Revert button that undoes every AI write attributed to that iteration. Closes the last open Workbench feature in the roadmap. - `data/ai/revert/inverse-operations.ts` — pluggable registry mapping event types to their undo actions. Ships with inverses for the five most common proposable outcomes: * TaskCreated → tasksStore.deleteTask * TaskCompleted → tasksStore.toggleComplete (back to incomplete) * CalendarEventCreated → eventsStore.deleteEvent * PlaceCreated → placesStore.deletePlace * DrinkLogged → drinkStore.deleteEntry Events with no registered inverse are tallied as `skippedUnsupported` — user knows to handle those manually rather than the service silently doing nothing. - `data/ai/revert/revert-iteration.ts` — orchestrator. Filters `_events` by `actor.iterationId + actor.missionId`, sorts newest-first (so a completion unwinds before the underlying task deletion), applies each inverse, returns `RevertStats` summary. - Workbench UI: Revert button with confirm dialog on every bucket. Shows "X zurückgenommen · Y nicht unterstützt · Z fehlgeschlagen" result alert. - 5 unit tests cover: happy path, unsupported types, failure isolation, user-event skipping, newest-first ordering. With this, the AI Workbench has full audit + undo semantics: user sees everything the AI did, can approve/reject at stage time, and can roll back approved actions after the fact. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| landing | ||
| mobile | ||
| web | ||