Remembering the Wrong Thing Is Still Remembering

Remembering the Wrong Thing Is Still Remembering
The stored policy says approval is optional. A correction says approval is required. Later the correction expires, and a query helpfully finds the older value again.
Nothing was forgotten accidentally. The retrieval rule deliberately selected the newest record that had not expired. It just implemented the wrong idea of current truth.
For external memory, correction needs a lifecycle. Otherwise old mistakes can wait politely behind newer facts until they get another chance.
Expiry is not supersession
Expiry says a value should no longer be used after a chosen time. Supersession says a newer decision replaced an earlier one. Those are different relationships.
A time-to-live, or TTL, limits how long data remains eligible for use. It doesn't necessarily mean deletion from storage. Nor should the expiry of a replacement automatically reverse the decision that replaced the old record.
For our fictional documentation assistant, I would first identify the latest accepted revision of a fact, then ask whether that revision remains usable. If not, the answer can be missing. It should not silently become the older answer.
A revision here is an application-assigned version number, not a confidence score from the model. The real write path needs an atomic way to assign revisions when concurrent updates are possible. The array example below assumes that ordering is already established by trusted code.
Represent the current state honestly
A fact can be found, missing or conflicted. Conflicted means the current accepted revision contains incompatible values, so the application cannot choose one by insertion order.
A deletion marker, often called a tombstone, records that a key should no longer resolve to an earlier value. It is a retrieval control, not by itself a complete personal-data erasure process.
Here is a small resolver over already-validated records. The record's owner and revision come from the application, not from text proposing its own authority:
type FactVersion = { ownerId: string; key: string; revision: number; kind: 'confirmed' | 'deleted'; value: string; sourceId: string; expiresAt: number | null; }; type Resolution = | { status: 'missing' | 'conflict' } | { status: 'found'; value: string; sourceIds: string[] }; function resolveFact( records: readonly FactVersion[], ownerId: string, key: string, now: number, ): Resolution { if (!Number.isFinite(now)) throw new Error('Invalid clock'); const matching = records.filter((record) => record.ownerId === ownerId && record.key === key); if (matching.length === 0) return { status: 'missing' }; if (matching.some((record) => !Number.isSafeInteger(record.revision) || record.revision < 1)) { throw new Error('Invalid revision'); } const revision = matching.reduce((latest, record) => Math.max(latest, record.revision), 0); const current = matching.filter((record) => record.revision === revision); if (current.some((record) => record.kind === 'deleted')) return { status: 'missing' }; if (current.some((record) => record.expiresAt !== null && ( !Number.isFinite(record.expiresAt) || record.expiresAt <= now ))) return { status: 'missing' }; if (new Set(current.map((record) => record.value)).size !== 1) return { status: 'conflict' }; return { status: 'found', value: current[0].value, sourceIds: [...new Set(current.map((record) => record.sourceId))], }; }
The critical ordering is visible: choose the latest revision before checking expiry. A stale latest revision produces missing. It does not reopen the history looking for an answer we previously replaced.
The rule that a deletion marker wins within the latest revision is deliberately conservative. It prevents an ambiguous concurrent state from re-exposing a supposedly forgotten value. A production store still needs conflict resolution and concurrency control; this resolver does not implement a distributed database.
Make the resurrection bug a fixture
Here is a synthetic pair of accepted facts. The numeric times are fixture values, not real policy dates:
const oldFact: FactVersion = { ownerId: 'reader-a', key: 'approval', revision: 1, kind: 'confirmed', value: 'optional', sourceId: 'policy-v1', expiresAt: null, }; const correction: FactVersion = { ...oldFact, revision: 2, value: 'required', sourceId: 'policy-v3', expiresAt: 200, }; const beforeExpiry = resolveFact([oldFact, correction], 'reader-a', 'approval', 100); const afterExpiry = resolveFact([oldFact, correction], 'reader-a', 'approval', 200); const afterForgetting = resolveFact([ oldFact, correction, { ...correction, revision: 3, kind: 'deleted', value: '', sourceId: 'forget-request-1' }, ], 'reader-a', 'approval', 100);
Before expiry, required is returned. At expiry, the result is missing, even though optional has no expiry date. After the deletion marker, retrieval remains missing.
These are observable properties of the retrieval policy, not evidence that the underlying source was correct or the user consented to storage. The application must establish those facts before writing accepted records.
Corrections should carry a reason to exist
I would record where a correction came from and which version it replaced. A later model's phrasing is not automatically stronger evidence than a current source document or an explicit user correction.
If two equally current accepted records disagree, I want the conflict visible. Taking the last array item turns storage order into an authority rule. A model-generated confidence field is not a reliable substitute.
Proposed corrections should remain outside the accepted revision sequence until the write policy approves them. Letting a model assign itself a larger revision would turn a storage convention into an easy authority claim. The example begins after that approval boundary; it doesn't demonstrate how to establish it from an untrusted suggestion.
Some conflicts can be resolved mechanically through a documented source precedence. Others need a person. The important part is to know which rule made the decision, rather than asking the next prompt to somehow prefer the right sentence.
Time also needs a contract. The example uses an application clock and a strict boundary where expiresAt equal to now is already expired. Real timestamps should use a consistent representation and not rely on free-form date strings generated by a model.
Forgetting has more than one destination
The tombstone prevents this resolver from returning older values. It doesn't erase those values from the array. That distinction matters.
If the requirement is actual deletion, the data lifecycle must address primary storage, replicas, search indexes, caches, exports and logs according to the applicable retention rules. Backups and service-specific retention may need separate handling. A visible success message from a memory tool does not prove all those copies disappeared.
Already-created conversation summaries can also contain the forgotten fact. The next request must not reload them as if they were fresh evidence. That is why correction affects both storage and context selection.
I would test the next lookup after correction, expiry and deletion, not merely assert that the write operation returned success. The retrieval path is where the stale value becomes behavior again.
Missing is sometimes the correct memory
I want a system that can say the accepted fact is no longer current, not a system that always finds something to say. An empty result can preserve the meaning of a correction better than a plausible answer from history.
The next complication is speed. Once we cache answers or reusable input, old values can survive outside the memory resolver. That does not make caching wrong, but it gives invalidation a very specific job.
After correcting a remembered fact, where would you check for its next appearance? I would start with the actual next request, not the storage operation's success flag.
A note from the author
I’m Maksym Kuzmitskyi, a senior software developer working mainly with React and TypeScript. I build frontend applications and design workflows for working with AI in software delivery. If this article connects with something you’re working on, I’d love to hear from you.
More than a blog post
I share frontend news and the reasoning behind it throughout the day. Pick the language that feels natural to you.