ADR 0200 — Synced memories keep the time they were first stored
- Status: Accepted
- Date: 2026-11-22
- Related: ADR 0017 (
recorded_at, the origin’s record time), ADR 0116 and ADR 0051 (what sync compares, unchanged), ADR 0176 (deletions, which already comparerecorded_at), ADR 0201 (the repair of memories already received), sync
Context
Section titled “Context”- What reads
timestamp. A memory’stimestamppayload field (a float index) drives:- the dashboard’s statistics: memories per month, and “added in the last 7 days” (
dashboard_summary,cli_viz); - recent lists, and the recent activity
wake_upgives a session; - background tagging’s newest-first order (ADR 0067).
- the dashboard’s statistics: memories per month, and “added in the last 7 days” (
- What sync wrote. Live sync stores received memories through
vectorstore.store_batch_precomputed. It settimestampto the time of arrival. The sender’stimestamptravelled in every record (MEMORY_FIELDS), but the importer dropped it. - The origin’s time survived elsewhere.
recorded_at, the time the origin device recorded the memory (ADR 0017), travels and is kept. - The owner’s report: memories from October showed up as November in the statistics.
- Measured read-only on the owner’s Windows store (388,411 memories) on 2026-11-22:
- 154,607 memories came from paired devices;
- 152,317 of them carried a
timestampmore than a minute after theirrecorded_at; - 77,572 were more than a day late. 77,084 of those were created in October and counted in November.
- Only this path was affected:
- Snapshot bundles (
imprint sync import) restore the vector store’s payloads unchanged. - Facts keep
valid_from. - Source snapshots keep their
updated_at.
- Snapshot bundles (
Decision
Section titled “Decision”- A received memory is dated when it was first stored. Its
timestampis set byvectorstore.first_stored:- the origin’s
recorded_at; - else the sender’s
timestamp; - else the time of arrival;
- and never later than the time of arrival, since a peer’s clock may run ahead.
- the origin’s
- The importer keeps the sender’s
timestamp. A record from before provenance, withoutrecorded_at, keeps the sender’s time.device.preparefills itsrecorded_atfrom that time, as it already did for any record that carries one. - Memories already received are dated back once per workspace by upkeep (ADR 0201). The repair applies to memories recorded by another device whose
timestampis more than a minute after theirrecorded_at: they takerecorded_at.- Memories recorded on this device are left alone, and so are memories without an origin.
- Each device repairs its own copies.
Rejected alternatives
Section titled “Rejected alternatives”- Make the views read
recorded_atinstead. Every reader oftimestampwould change: statistics, recent lists,wake_up, the tagging order and Organize’s profile times.recorded_athas no payload index, and memories stored before provenance lack it. - Send a new field or raise the sync protocol. The right time already travels. Old devices keep working with new ones in both directions.
- Rewrite the dates through sync. Sync compares memory ids and classification times (ADRs 0116, 0051), never
timestamp, so a repaired date would not travel. It does not need to: every device dates its own copies.
Consequences
Section titled “Consequences”- Statistics show when a memory was made, on every device.
- Months count memories by their creation.
- “Added in the last 7 days” counts memories made in the last week, wherever they were made. A first sync of old memories no longer inflates it.
- Recent lists follow creation time. The recent lists and a session’s recent activity show a peer’s memories at their creation time, so a large sync no longer floods them.
- Background tagging orders received memories by creation time.
- Sync is unchanged. A repaired or received date changes nothing sync compares, so no memory is sent again.
- Mixed versions keep working. A device that has not updated still dates arrivals by arrival; once updated, its upkeep repairs them.
timestampchanges meaning for received memories. On a receiving device it no longer says when the memory arrived there. Nothing uses that today.
Invalidation conditions
Section titled “Invalidation conditions”- If something needs the arrival time (for example “what sync brought today”), then add an arrival field rather than redating
timestamp. - If a device’s clock was wrong when it recorded memories, so that
recorded_atis far off, then prefer the sender’stimestampfor that device’s memories, or ask the user.
Validation
Section titled “Validation”tests/test_upkeep.py, on Windows Python 3.13:first_storedprefers the origin’s time, then the sender’s, never returns a time past arrival, and refuses non-numbers.- A sync exported from device A and imported on device B keeps October for three memories: one recorded in October, one A itself received late (
recorded_atwins), and one withoutrecorded_at(the sender’s time, which also fillsrecorded_at). - The repair step: see ADR 0201.
test_device_provenance,test_sync_deletionsandtest_background_taggingpass unchanged.- A read-only dry run of the repair on the owner’s store would date back 152,317 memories from paired devices.