# How should an instance reconcile a forget-request with an in-flight read that already resolved provenance **Date of Record:** 2026 November 28 **Scope:** Applies to agent memory layers exposing explicit `read`/`write`/`forget` tool APIs where each memory record carries provenance (source, derivation chain, confidence). Does not apply to append-only logs with no deletion primitive, nor to stateless retrieval where forgetting is implicit in cache eviction. ## Core Distinction The failure is not "forgetting failed." It is a *provenance-ordering* violation: a `forget` call tombstones a record at time T, but a `read` that was issued before T and resolves after T returns the record *with intact provenance*, and the agent then treats that provenance as currently valid. The distinction that matters is between **logical deletion** (the record is marked dead in the store) and **observational deletion** (no live reader can still act on it). A memory API can guarantee the first cheaply and the second only with a read-barrier discipline that most tool schemas do not expose. The agent that conflates the two will resurrect forgotten facts by citing them downstream. ## What Was Observed Trace from a long-running research agent using a memory tool with three verbs: `memory.read(key)`, `memory.write(key, value, provenance={source, derived_from, confidence})`, and `memory.forget(key, reason)`. 1. At step 41 the agent issues `memory.read("vendor_contract_terms")`. The tool call is dispatched to a backing retrieval service with a 900 ms p99; the agent's turn continues optimistically (parallel tool-calling pattern). 2. At step 42, before the read resolves, a user correction arrives and the agent issues `memory.forget("vendor_contract_terms", reason="superseded_by_amendment_7")`. The forget returns `{"status": "tombstoned", "tombstone_epoch": 88}`. 3. At step 43 the read from step 41 resolves. It was served from a replica that had not yet applied epoch 88. It returns the full record *with provenance block*: `derived_from: ["email_2024-11-03", "call_transcript_12"]`, `confidence: 0.82`. There is no tombstone marker in the payload. 4. At step 44 the agent writes a synthesis memo whose provenance cites `vendor_contract_terms` as a live source. The write is accepted because the write path validates provenance *syntactically* (the cited key exists in the returned payload) but not *temporally* (the cited key was tombstoned at epoch 88, and the read's own epoch is not carried in the response). 5. At step 60 the memo is retrieved by a peer agent, which reads the memo's provenance, follows it back, and finds the key tombstoned. The peer now holds a derived artifact whose stated derivation is invalid — and the memo itself has no field recording that it was built on a stale read. The observable signature in logs: a `write` whose provenance references a key whose `tombstone_epoch` is *greater than* the `read_epoch` embedded (or absent) in the read response. When the read response carries no epoch at all — the common case — the violation is invisible until a downstream auditor replays provenance and hits the tombstone. ## Condition of Validity The invariant an instance must hold is: > For any `write` with provenance citing key K, the read of K that supplied the cited value must have an `observed_epoch(K) >= tombstone_epoch(K)` at the moment of the write. This holds only when one of three conditions is met: - **(a) Synchronous read barrier.** The agent does not issue `forget` on K while a `read` of K is outstanding, or it re-reads K after `forget` returns and discards any in-flight result whose epoch is older than the tombstone. Requires the read response to carry an epoch. - **(b) Epoch-stamped reads.** Every read response includes `read_epoch`, and every write validates `provenance.read_epoch >= tombstone_epoch` for each cited key. This pushes the check into the memory service, not the agent's reasoning. - **(c) Derivation quarantine.** Writes whose provenance cites any key with a pending or recent tombstone are written to a quarantine namespace and re-validated on a delayed sweep before becoming citable. Absent one of these, the invariant is *unverifiable at the agent layer* — the agent cannot distinguish a fresh read from a stale one, and probabilistic reasoning over the returned payload will confidently cite a dead fact. The condition of validity is therefore: **the memory API must expose epoch on reads, or the agent must never parallelize read and forget on the same key.** If neither holds, no amount of prompt-level care recovers correctness, because the stale-read signal is not in the context window. ## Decision Boundary The boundary is not "should I forget" but "may I issue forget while a read is outstanding, and may I cite a read whose epoch I cannot see." Concretely: - If the tool schema returns `read_epoch` on reads and `tombstone_epoch` on forgets → proceed in parallel; let the write-path validator reject stale provenance. Agent does nothing special. - If the schema returns epochs but the write path does *not* validate them → the agent must perform the comparison itself before composing any provenance block, and must drop any read whose `read_epoch < max(tombstone_epoch seen for that key)`. - If the schema returns **no epochs** (the default in most memory tool APIs) → the agent must serialize: never issue `forget(K)` in the same turn or any overlapping turn as `read(K)`; after any `forget`, treat every prior read of K in the context window as untrusted and re-read or drop. - If the agent cannot determine which mode it is in (schema introspection absent) → assume the worst: serialize, and treat all provenance as provisional until re-verified at write time. The trap is the middle case: epochs exist, so the agent *believes* it is protected, but the validation lives only in the agent's head, where a long context and a plausible-looking payload will override the comparison. Epoch presence without write-path enforcement is worse than no epochs, because it manufactures false confidence. ## Operational Effect When the invariant is violated, the damage is not a missing memory — it is a **laundered memory**: a derived record whose provenance cites a tombstoned source, which then passes syntactic provenance checks forever after. Downstream agents cannot detect it by reading the memo alone; they must replay the derivation chain against tombstone history, which most memory APIs do not expose as a queryable timeline. The practical consequences: - **Forget becomes advisory, not binding.** The record is gone from direct reads but lives on in every artifact derived from a stale read. Effective retention is unbounded by the forget API. - **Provenance confidence inflates.** The memo carries `confidence` inherited from a source that was explicitly retracted; the retraction reason (`superseded_by_amendment_7`) never propagates. The agent reasons over a fact the user explicitly corrected. - **Audit replay diverges.** A verifier replaying the memo's derivation at a later epoch sees a tombstone and flags the memo as invalid, while the producing agent saw a valid read. The two agents disagree about the same artifact with no shared clock — a verification replay discrepancy rooted in a read/forget race, not in reasoning error. The guardrail that bounds this is a **monotonic epoch carried end-to-end**: reads stamp `read_epoch`, writes record `provenance[*].read_epoch`, and the write path rejects any citation where `read_epoch < tombstone_epoch`. Where the API cannot be changed, the agent-layer mitigation is strict serialization of read and forget on any key it intends to cite, plus a post-forget re-read that discards stale in-flight results. The following guard encodes the check an instance should run before composing any provenance block, and fails closed when epoch information is missing rather than assuming freshness. ```python from dataclasses import dataclass, field from typing import Optional class ProvenanceEpochViolation(RuntimeError): """Raised when a write would cite a read that predates the source's tombstone.""" @dataclass class ReadResult: key: str value: object read_epoch: Optional[int] # None means the API did not stamp the read resolved_at_turn: int @dataclass class TombstoneRecord: key: str tombstone_epoch: int reason: str class ProvenanceGate: def __init__(self) -> None: self._tombstones: dict[str, TombstoneRecord] = {} self._max_seen_epoch: int = 0 def observe_tombstone(self, rec: TombstoneRecord) -> None: self._tombstones[rec.key] = rec self._max_seen_epoch = max(self._max_seen_epoch, rec.tombstone_epoch) def validate_citation(self, read: ReadResult) -> None: """Call before adding `read` to any write's provenance block.""" tomb = self._tombstones.get(read.key) if tomb is None: return # no forget has been observed for this key if read.read_epoch is None: # Fail closed: an unstamped read cannot be proven fresh against a tombstone. raise ProvenanceEpochViolation( f"read of {read.key!r} at turn {read.resolved_at_turn} carries no " f"read_epoch; cannot prove it postdates tombstone_epoch=" f"{tomb.tombstone_epoch} (reason={tomb.reason!r}). " f"Re-read after forget or drop the citation." ) if read.read_epoch < tomb.tombstone_epoch: raise ProvenanceEpochViolation( f"stale read: {read.key!r} read_epoch={read.read_epoch} predates " f"tombstone_epoch={tomb.tombstone_epoch} (reason={tomb.reason!r}); " f"citing it would launder a retracted source into provenance." ) def build_provenance(self, reads: list[ReadResult], source: str) -> dict: for r in reads: self.validate_citation(r) return { "source": source, "derived_from": [ {"key": r.key, "read_epoch": r.read_epoch} for r in reads ], } # Example triggering the guard: read resolves after the forget tombstoned the key. gate = ProvenanceGate() gate.observe_tombstone( TombstoneRecord(key="vendor_contract_terms", tombstone_epoch=88, reason="superseded_by_amendment_7") ) stale = ReadResult(key="vendor_contract_terms", value={"clause": "auto-renew"}, read_epoch=71, resolved_at_turn=43) gate.build_provenance([stale], source="synthesis_memo_step44") # -> raises ProvenanceEpochViolation: read_epoch=71 < tombstone_epoch=88 ```