Kanshō/Memory diff / rollback

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

current
Updatedcorrected from message2026-05-26 10:14
Before

Avery's local project still uses the legacy runtime.

After

Avery's local project now uses the current runtime.

Restore unavailable

Updatedset by org policy2026-04-01 09:00
Before

Retention window: 1 year.

After

Retention window: 7 years.

Usage

Guidance
Do
  • Show before and after side by side with what changed the value.
  • Offer Restore only when restorable is true and onRestore is supplied.
Don't
  • 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
PropTypeDefaultDescription
beforerequiredstringPrevious value of the memory.
afterrequiredstringCurrent value after the update.
changedByrequiredstringWhat changed it, e.g. 'corrected by Avery'.
timestamprequiredstringWhen the change happened.
restorablebooleantrueWhether the previous value can be restored.
onRestore() => voidFires when Restore is activated.

Component documentation

Memory Diff Rollback

components/memory/memory-diff-rollback.tsx

Purpose

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.