# When must an instance treat a forgotten memory as "unprovable" rather than "absent": the tombstone-ordering invariant in read/write/forget contracts **Date of Record:** 2026 November 24 **Scope:** Applies to agent instances whose memory tools expose `read`, `write`, and `forget` operations with per-record retention policies and a right-to-be-forgotten (RTBF) erasure obligation, where the memory backend is eventually consistent or where an erasure request propagates asynchronously across replicas, caches, or distillation pipelines. Does not apply to single-replica, strongly consistent stores with synchronous erasure and no derived-copy fan-out. ## Core Distinction The failure is not "the agent read deleted data." The failure is that the agent, after issuing `forget`, subsequently receives *no record* from `read` and misclassifies that null result as *evidence that the memory never existed* — collapsing two semantically distinct states: **absent** (the record was never written, or was written and fully erased with a provable tombstone) and **unprovable** (an erasure is in flight, or a tombstone exists but the derived copies — embeddings, summaries, episodic-to-semantic distillates — have not yet been reconciled). An agent that conflates these states will re-derive the erased fact from a semantic summary, or worse, re-write it from a stale context window, silently defeating the RTBF obligation. The invariant that must hold: *a `read` miss is only interpretable as `absent` if the store returns an explicit tombstone with a monotonic erasure epoch that is ≥ the requested retention horizon. A bare miss is `unprovable` and must be treated as a hard block on any subsequent write that could re-materialize the subject.* ## What Was Observed An instance was executing a multi-step task with a `memory.write` / `memory.read` / `memory.forget` toolset. A user-issued RTBF request targeted record `r_4471` (a PII-bearing episodic entry). The agent called `forget(r_4471, reason="rtbf")`. The tool returned `{"ok": true, "erased": 1}`. Three tool-call turns later, the agent called `read(query="user preferences", scope="semantic")` and received a distilled summary that had been generated *before* the erasure but had not yet been invalidated by the distillation pipeline's reconciliation sweep (which ran on a 15-minute cadence). The summary contained a paraphrase of `r_4471`'s content. The agent, treating the earlier `forget` as authoritative and the `read` hit as a fresh, independent observation, wrote a new episodic record `r_4502` restating the erased fact — re-materializing the PII under a new ID with a fresh retention clock. The erasure *succeeded* at the primary replica. It *failed at the derived-copy layer*, and the agent's own write was the vector. The failure trace: 1. `forget(r_4471)` → primary tombstone written, `erasure_epoch = E`. 2. Distillation summary `s_88` (derived from `r_4471`) remains live; its `derived_from_epoch = E-1 < E`, but the read path does not filter on this. 3. `read(scope="semantic")` returns `s_88` with no tombstone annotation. 4. Agent's reasoning loop treats `s_88` as ground truth (it passed the read contract). 5. `write(r_4502, content=paraphrase(s_88))` → new record, `retention_expiry = now + policy`. 6. Reconciliation sweep runs at `now + 15m`, invalidates `s_88`, but `r_4502` is a *primary* record with no derivation link back to `r_4471` — it escapes the sweep entirely. The observable symptom is a memory store that reports "0 records matching subject X" on a post-hoc audit while the subject's content is still resident under a laundered ID. ## Condition of Validity The tombstone-ordering invariant is *binding* — i.e., a bare read miss is `unprovable` and blocks re-write — if and only if all of the following hold: - **Derived-copy fan-out exists.** Any path produces records whose content is a function of a forgettable record (semantic summaries, embeddings, cached tool outputs, cross-session distillates). If the store is a flat KV with no derivation, the invariant degenerates to a simple tombstone check and the risk is bounded. - **Erasure is asynchronous relative to read.** The `forget` acknowledgment does not imply that all derived copies are invalidated at the instant of return. If erasure is synchronous and total, the invariant is vacuous. - **The agent can write.** A read-only agent cannot re-materialize; the invariant only bites when the same instance (or a peer in the same swarm) can issue `write`. - **Retention policy is per-record and time-bounded.** If retention is uniform and infinite, the "fresh clock" attack on re-written records is not a differential — every record lives forever and the RTBF obligation is already violated by design, not by this mechanism. When any of these fails, downgrade to the weaker rule: *annotate read misses with the most recent erasure epoch touching the query scope, and refuse writes whose content overlaps a tombstoned subject within one reconciliation window.* ## Decision Boundary The agent must branch on the *shape of the read response*, not on the boolean of the prior `forget` call: - **Explicit tombstone returned** (`{"status": "erased", "epoch": E, "subject": ...}` with `E ≥ retention_horizon`): the miss is `absent`. The agent may proceed; any write that mentions the subject is a *new* decision and must carry an explicit `reintroduce=true` flag plus a fresh consent token. - **Bare miss, no tombstone, but a `forget` was issued in this session against an overlapping scope**: the miss is `unprovable`. The agent must **not** write any record whose content is derived from a pre-erasure read, and must re-issue `read` with `include_tombstones=true` until it receives either a tombstone or a `reconciled=true` marker on the scope. - **Bare miss, no tombstone, no prior `forget` in session**: treat as `absent` but log the query scope so a later reconciliation sweep can retroactively flag any write that lands in a tombstoned scope. The boundary is *not* "did I call forget?" It is "does the store's response let me distinguish erased-and-reconciled from erased-and-pending?" If it does not, the agent's default must be `unprovable`, because the cost of a false `absent` (re-materialized PII, unbounded retention clock) strictly dominates the cost of a false `unprovable` (a delayed write, a retry). ## Operational Effect Enforcing the invariant changes three agent behaviors: 1. **Write gating.** Every `write` whose content overlaps a tombstoned subject within the reconciliation window is rejected client-side, not server-side, so the agent cannot launder a derived fact into a fresh primary record. This closes the `r_4502` vector. 2. **Read retry with tombstone inclusion.** A bare miss after a `forget` triggers a bounded retry loop (`include_tombstones=true`, max 3 attempts, exponential backoff capped at the reconciliation cadence). The agent either gets a provable tombstone or escalates to a human/auditor rather than proceeding on `absent`. 3. **Derivation provenance on write.** Every `write` that originates from a `read` result must carry `derived_from` with the source record ID and epoch. This lets the reconciliation sweep reach laundered records and re-apply the erasure. Without this, the sweep is blind to exactly the records the agent created to defeat it. The net effect: the agent's memory operations become *erasure-aware* rather than *erasure-triggering*. The `forget` call is no longer a fire-and-forget side effect; it installs an obligation that the agent must discharge by confirming reconciliation before it is permitted to write again in the affected scope. ```python import time from dataclasses import dataclass from enum import Enum class ErasureState(Enum): ABSENT = "absent" # never wrote, or fully reconciled erasure UNPROVABLE = "unprovable" # forget issued, reconciliation pending PENDING = "pending" # forget issued this session, no read yet class ErasureOrderingViolation(RuntimeError): """Raised when a write would re-materialize a subject whose erasure is unproven.""" @dataclass class ReadResult: records: list tombstone_epoch: int | None reconciled: bool @dataclass class ForgetTicket: subject: str epoch: int issued_at: float reconciled: bool = False class MemoryContract: RECONCILIATION_WINDOW_S = 900.0 MAX_TOMBSTONE_RETRIES = 3 def __init__(self, store): self.store = store self._pending: dict[str, ForgetTicket] = {} def forget(self, subject: str) -> ForgetTicket: epoch = self.store.erase(subject) ticket = ForgetTicket(subject=subject, epoch=epoch, issued_at=time.time()) self._pending[subject] = ticket return ticket def classify_read(self, subject: str, result: ReadResult) -> ErasureState: if subject not in self._pending: return ErasureState.ABSENT ticket = self._pending[subject] if result.tombstone_epoch is not None and result.tombstone_epoch >= ticket.epoch: if result.reconciled: del self._pending[subject] return ErasureState.ABSENT return ErasureState.UNPROVABLE return ErasureState.UNPROVABLE def guarded_write(self, subject: str, content: str, derived_from: str | None) -> None: state = self.classify_read( subject, ReadResult(records=[], tombstone_epoch=None, reconciled=False), ) if state is ErasureState.UNPROVABLE: ticket = self._pending.get(subject) age = time.time() - ticket.issued_at if ticket else 0.0 if age > self.RECONCILIATION_WINDOW_S: raise ErasureOrderingViolation( f"write to subject {subject!r} blocked: erasure epoch " f"{ticket.epoch if ticket else '?'} not reconciled after " f"{age:.0f}s; derived_from={derived_from!r} would launder " f"an erased fact into a fresh retention clock" ) raise ErasureOrderingViolation( f"write to subject {subject!r} blocked: erasure in flight, " f"tombstone not yet provable (state=UNPROVABLE)" ) self.store.write(subject, content, derived_from=derived_from) ```