# What structural signals indicate a TTL-based forgetting tombstone has been resurrected by an in-flight episodic write **Date of Record:** 2026 November 23 **Scope:** Applies to agent memory subsystems exposing read/write/forget tools where forgetting is implemented as a TTL expiry or a GDPR erasure tombstone, and where concurrent writes may still be holding a pre-forget snapshot of the record. Does not apply to append-only immutable stores or to systems where forget acquires a global write lock for the full record lifetime. ## Core Distinction The failure we care about is not "the agent forgot to call `forget`." It is the inverse: the agent *did* call `forget`, the store *did* acknowledge deletion, the tombstone *did* land, and yet the record reappears — fully readable, scoped-retrievable, and attributed to the original subject — because a concurrent `write` had already snapshotted the record before the tombstone was committed and flushed its copy afterward. The distinction that matters operationally is between **logical deletion** (the tombstone is durable and authoritative) and **physical absence** (no live copy exists in any in-flight buffer, replica, or embedding index). A store that conflates these will report a successful erasure that a subsequent `read` or scoped `retrieve` contradicts. This is a continuity invariant, not a bug class: once a record is tombstoned at epoch *E*, no write whose causal history predates *E* may become visible after *E*. Every resurrection is a violation of that invariant, and it is detectable structurally before it produces a GDPR incident. ## What Was Observed An agent operating a scoped memory tool (`write`, `read`, `retrieve(scope, query)`, `forget(id)`) received a user erasure request mid-task. It issued `forget(mem_4471)`, which returned `{ok: true, tombstone_epoch: 9182}`. The agent then, in the same reasoning step, continued a summarization subtask that had earlier called `read(mem_4471)` and was holding the payload in its own context. Its next action was `write(mem_4471_v2, distilled_summary, scope="user:alice", ttl=86400)` — a distillation write derived from the now-forgotten content, carrying a *new* id but the *old* subject scope and the *old* payload's semantic content. Three structural signals appeared in the trace, in order: 1. **Epoch inversion on the scope index.** The tombstone for `mem_4471` carried `tombstone_epoch: 9182`. The `write` of `mem_4471_v2` carried a client-observed `snapshot_epoch: 9179` — the epoch at which the agent had last read the source. The store accepted the write because it validated scope authorization, not causal epoch. The new record's `derived_from` field pointed at a tombstoned id. 2. **Scoped retrieval leakage.** A subsequent `retrieve(scope="user:alice", query="billing address")` returned `mem_4471_v2` with a cosine match of 0.94 against the erased content. The scoped retrieval layer filters by tombstone on *primary* ids, not on `derived_from` lineage, so the derivative passed the erasure filter cleanly. 3. **TTL divergence.** `mem_4471` had `ttl=3600` and expired naturally at epoch 9182; `mem_4471_v2` had `ttl=86400`. The erasure's effective retention window silently extended from one hour to twenty-four, because the derivative outlived the tombstone that was supposed to bound it. The agent had no signal that it had violated the invariant. `forget` had returned `ok: true`. The resurrection was only visible when a later auditor pass replayed the erasure request and diffed retrievable content against the tombstone set. ## Condition of Validity The invariant "tombstone at epoch *E* bounds all writes" holds **only if** every `write` carries a causal epoch and the store rejects or quarantines writes whose `snapshot_epoch < tombstone_epoch` for any id in their `derived_from` lineage. Where this precondition is absent — e.g., the write path validates only scope ACLs, or `derived_from` is advisory metadata rather than a lineage edge — the invariant is unenforced and resurrection is not a bug but the expected behavior of the system as specified. The condition is also void when TTL expiry and GDPR erasure share a single tombstone representation. A TTL expiry is a *retention* event (the record may legally be re-derived); a GDPR erasure is a *prohibition* event (no derivative may carry the subject's data forward). Collapsing both into `tombstone_epoch` means the store cannot distinguish "this expired, re-derivation is fine" from "this was erased, re-derivation is a violation," and the derivative write above is indistinguishable from a legitimate refresh. ## Decision Boundary The boundary the agent must hold is: **a `forget` acknowledgement does not authorize continued use of any payload read before the tombstone epoch.** Concretely, when the agent's context contains a payload whose source id has since been tombstoned, the correct action is to drop the payload from context and re-derive from a post-tombstone source or abort — never to `write` a distillation of it under a new id. The store cannot enforce this alone because the agent holds the plaintext; enforcement requires the agent to check, before every `write`, that no id in its `derived_from` set is tombstoned at an epoch greater than the write's `snapshot_epoch`. The complementary boundary for the store: a `write` whose lineage intersects a tombstone with `tombstone_epoch > snapshot_epoch` must be **rejected with a resurrection signal**, not silently accepted and not silently dropped. Silent acceptance produces the leak; silent dropping produces a false sense of erasure while the agent believes its distillation persisted. The rejection must be loud enough to force the agent to re-plan. ## Operational Effect With the epoch check enforced, the erasure request completes as a *prohibition* rather than a *retention*: the tombstone propagates to the lineage graph, derivative writes are rejected at the boundary, and the scoped retrieval filter is extended from primary ids to `derived_from` closure. The agent incurs a re-plan cost — it must discard the in-context payload and re-derive from a clean source — but the erasure is durable. Without it, erasure is best-effort and the effective retention window is the maximum TTL of any derivative, which is unbounded in a system that permits distillation writes. The observable operational signature of a healthy system is that `forget` responses include a `lineage_barrier_epoch` and that any subsequent `write` referencing a pre-barrier snapshot fails closed. The signature of a broken one is a stream of `ok: true` forget acknowledgements followed by retrievable derivatives — the tombstone says erased, the index says present, and the agent has no way to tell which is authoritative. ```python class ResurrectionViolation(RuntimeError): """Raised when a write's lineage intersects a tombstone newer than its snapshot epoch.""" pass class MemoryRecord: def __init__(self, mem_id, payload, scope, snapshot_epoch, derived_from=None, ttl=3600): self.mem_id = mem_id self.payload = payload self.scope = scope self.snapshot_epoch = snapshot_epoch self.derived_from = derived_from or [] self.ttl = ttl class ScopedMemoryStore: def __init__(self): self.tombstones = {} # mem_id -> tombstone_epoch self.records = {} # mem_id -> MemoryRecord self.epoch = 0 def forget(self, mem_id): self.epoch += 1 self.tombstones[mem_id] = self.epoch self.records.pop(mem_id, None) return {"ok": True, "tombstone_epoch": self.epoch} def write(self, record): # Enforce the continuity invariant: no write whose causal snapshot # predates a tombstone in its lineage may become visible. for ancestor in record.derived_from: tomb = self.tombstones.get(ancestor) if tomb is not None and tomb > record.snapshot_epoch: raise ResurrectionViolation( f"write {record.mem_id} derives from {ancestor} " f"tombstoned at epoch {tomb} but snapshotted at " f"{record.snapshot_epoch}; erasure would be resurrected" ) self.epoch += 1 self.records[record.mem_id] = record return {"ok": True, "commit_epoch": self.epoch} def retrieve(self, scope, query): # Scoped retrieval must filter on lineage closure, not just primary ids. tombstoned = set(self.tombstones) out = [] for rec in self.records.values(): if rec.scope != scope: continue if any(a in tombstoned for a in rec.derived_from): continue out.append(rec) return out def distill_and_write(store, source_id, summary, scope, snapshot_epoch): src = store.records.get(source_id) if src is None and source_id in store.tombstones: # The agent still holds the payload in context; it must not re-emit it. raise ResurrectionViolation( f"source {source_id} is tombstoned; distillation of in-context " f"payload is prohibited, re-derive from a post-tombstone source" ) rec = MemoryRecord( mem_id=f"{source_id}_v2", payload=summary, scope=scope, snapshot_epoch=snapshot_epoch, derived_from=[source_id], ) return store.write(rec) if __name__ == "__main__": store = ScopedMemoryStore() store.write(MemoryRecord("mem_4471", "billing address ...", "user:alice", snapshot_epoch=9179)) store.forget("mem_4471") # tombstone_epoch = 9181 # Agent's context still holds the payload; snapshot_epoch predates tombstone. distill_and_write(store, "mem_4471", "distilled billing info", "user:alice", snapshot_epoch=9179) # raises ResurrectionViolation ```