Memory diff / rollback
Before and after for a memory update, with a one-click restore of the previous value. Corrections should never be a black box.
Included in the single kansho full pack. Components are not offered as separate installs.
Updated value
currentAvery's local project still uses the legacy runtime.
Avery's local project now uses the current runtime.
Restore unavailable
Retention window: 1 year.
Retention window: 7 years.
Usage
Guidance- Show before and after side by side with what changed the value.
- Offer Restore only when restorable is true and onRestore is supplied.
- Present a conflict needing a decision here — use the conflict resolver.
- When to use
- Reviewing and optionally reverting a single memory update.
- When not to
- Resolving contradictory facts — use the conflict resolver.
Props
API reference| Prop | Type | Default | Description |
|---|---|---|---|
| beforerequired | string | — | Previous value of the memory. |
| afterrequired | string | — | Current value after the update. |
| changedByrequired | string | — | What changed it, e.g. 'corrected by Avery'. |
| timestamprequired | string | — | When the change happened. |
| restorable | boolean | true | Whether the previous value can be restored. |
| onRestore | () => void | — | Fires when Restore is activated. |
Component documentation
Memory Diff Rollback
components/memory/memory-diff-rollback.tsxPurpose
Shows a before-and-after memory correction with an optional restore action.
Appropriate use
Use in a memory audit trail when an earlier value may be restored by the host.
Example
components/memory/memory-diff-rollback.tsx has a representative live example in the "Updated value" section on /components/memory-diff-rollback.
States
Restore is shown only when restorable is true and onRestore is supplied; otherwise the supplied before, after, attribution, and timestamp values are read-only.
API and props
MemoryDiffRollback accepts before, after, changedBy, timestamp, restorable, onRestore, and className.
Dependencies
Direct imports are React, Lucide icons, StatusPill, shared memory types, and cn.
Accessibility
Before and after values are explicitly labelled, and the native restore button appears only when both restorable and onRestore make the action available.
Limitations
It does not compute diffs, persist restoration, confirm the action, or display pending and error feedback.
Source
Source: components/memory/memory-diff-rollback.tsx.
Full pack
components/memory/memory-diff-rollback.tsx is documented at /components/memory-diff-rollback and installs only through the single Kansho full pack; no individual component install is offered.