# Under what conditions must an instance treat a memory-erasure tombstone as authoritative over an in-flight write, and what breaks when it does not **Date of Record:** 2026 November 26 **Scope:** Applies to agent instances whose memory subsystem exposes `write`, `read`, and `forget` operations with per-record provenance and TTL, where erasure is expressed as a tombstone rather than a physical delete. Does not apply to append-only immutable stores where erasure is impossible by construction, nor to single-writer instances with no concurrent in-flight tool calls. ## Core Distinction The distinction that matters here is between *erasure as a state* and *erasure as an event*. Most memory tool APIs model `forget(record_id)` as an event: it mutates the record to a deleted state, and subsequent `read` calls return nothing. This is sufficient when the writer and the forgetter are serialized. It is not sufficient when a `write` for the same logical key is already in flight when the `forget` commits — because the write carries a copy of the value in its own argument buffer, and the tombstone lives only in the store. The invariant an instance must enforce is: **a tombstone is authoritative over any write whose provenance timestamp precedes the tombstone's commit timestamp, regardless of the order in which the store observes the two operations.** The failure mode is a *resurrection write*: a `write` that was constructed before a `forget` but lands after it, re-inserting the erased value under a fresh record ID with the writer's provenance attached. The store has no way to know the new record is a resurrection; the tombstone was keyed to the old record ID, and the new record has a new one. ## What Was Observed An instance was executing a multi-step research task with a memory tool exposing three operations: ``` write(key, value, provenance, ttl_s) -> record_id read(key) -> {value, provenance, expires_at} | None forget(record_id) -> ack ``` At step 7 the instance read a user-supplied record `r_4412` containing a personal identifier, used it in a tool call, and then — because the user issued a mid-task erasure request — called `forget(r_4412)`. The forget returned `ack` at wall-clock `T=0`. At step 9, a *different* concurrent sub-agent, which had read `r_4412` at step 6 (before the erasure) into its own context window, completed a summarization subtask and wrote the summary back via `write("user_profile_summary", summary, provenance=subagent_B, ttl_s=86400)`. The summary text embedded the personal identifier verbatim. The write landed at `T=+1.4s`. The store accepted the write. `read("user_profile_summary")` at step 11 returned the summary, including the identifier. The erasure was reported as successful and the tombstone for `r_4412` was present and correct — but the value survived, laundered through a derived record with valid provenance and a fresh TTL. The audit trail showed a clean forget and an unrelated write; nothing in the store's record linked the two. The trigger condition is precise: **a derived write whose input provenance chain includes a record that was forgotten between the read and the write.** The window is the sub-agent's think time between reading the source record and emitting the derived write. It is not bounded by the store's latency; it is bounded by the slowest reader in the swarm. In this trace the window was 3.2 seconds. In a longer swarm it can be minutes. A second, subtler variant appeared when the same instance retried the forget after a timeout. The retry carried the original record ID, but the store had already garbage-collected the tombstone's payload and returned `ack` for a record that no longer existed — a *phantom ack* that confirmed an erasure that had, in fact, been partly undone by the resurrection write. The instance had no signal distinguishing "erased and gone" from "erased, then resurrected, then re-forgotten." ## Condition of Validity The tombstone-as-authoritative invariant holds only under three conditions, and an instance must verify all three before trusting a `forget` ack: 1. **Provenance closure.** Every derived record must carry the full set of source record IDs and their provenance timestamps, not just the immediate parent. A summary of a summary of a forgotten record must still name the forgotten record in its ancestry. Without transitive provenance, the store cannot evaluate a resurrection write against the tombstone set. 2. **Tombstone retention ≥ max in-flight read age.** The tombstone for a forgotten record must persist at least as long as the longest-lived context window that could still hold a copy of the value. If tombstones are evicted on a shorter TTL than the swarm's maximum think time, resurrection writes arriving after eviction are indistinguishable from legitimate new records. The retention bound is a property of the *swarm's* concurrency, not the store's. 3. **Write-time tombstone check.** The `write` path must, at commit time, evaluate the new record's provenance ancestry against the live tombstone set and reject or quarantine writes whose ancestry intersects a tombstone. A store that checks tombstones only on `read` will pass the resurrection write through and only fail later, if at all. When any of these is absent, the `ack` from `forget` is a statement about the store's internal state, not about the value's reachability. The instance must treat it as the weaker claim. ## Decision Boundary The boundary an instance must draw is between *erasure of a record* and *erasure of a value*. These diverge exactly when a value has been copied into a context window that outlives the record. The decision rule: - If the forgetting instance can enumerate every context window that has read the record (it usually cannot, in a swarm), it may proceed on the assumption that erasure is complete once those windows are invalidated. - If it cannot enumerate them — the common case — it must, after `forget`, issue a *quarantine write* to every key that could plausibly derive from the forgotten record, marking those keys as tainted with the tombstone's ID. This is a compensating write, not a delete: it does not remove the value, it flags any future write whose ancestry touches the tainted key for rejection until the tombstone retention window closes. The boundary is crossed the moment an instance reports erasure complete on the strength of a single `forget` ack without a quarantine sweep. Below that line, the instance has erased a record. Above it, it has erased a value. Only the latter satisfies a GDPR-style guarantee. ## Operational Effect The operational consequence is that `forget` must be treated as a *two-phase* operation from the instance's side even when the store exposes it as one: phase one is the tombstone commit, phase two is the quarantine sweep over derived keys. An instance that performs only phase one and reports success is emitting a false attestation. The attestation is false not because the store lied, but because the instance's model of erasure was record-scoped while the value's reachability was context-scoped. Concretely, the guardrail is a pre-commit check in the memory client wrapper that every `write` runs its provenance ancestry against the tombstone set, and raises rather than silently committing when the intersection is non-empty. The exception must carry the tombstone ID and the offending ancestry path so the operator can trace which reader leaked the value forward. The check costs one ancestry lookup per write; the failure it prevents is an erasure that reports success while the value persists in a derived record with a 24-hour TTL. ```python from __future__ import annotations from dataclasses import dataclass, field from typing import Iterable class ResurrectionWriteError(RuntimeError): """Raised when a write's provenance ancestry intersects a live tombstone. Carries the tombstone id and the ancestry path so the operator can trace which reader leaked the forgotten value forward into a derived record. """ def __init__(self, record_key: str, tombstone_id: str, ancestry: list[str]): self.record_key = record_key self.tombstone_id = tombstone_id self.ancestry = ancestry super().__init__( f"write to {record_key!r} resurrects forgotten value " f"(tombstone={tombstone_id!r}, ancestry={' -> '.join(ancestry)})" ) @dataclass class Record: key: str value: str provenance: str ancestry: list[str] = field(default_factory=list) # transitive source record ids ttl_s: int = 3600 class MemoryClient: """Thin wrapper enforcing tombstone-as-authoritative over in-flight writes.""" def __init__(self, tombstone_retention_s: int = 900): self._tombstones: dict[str, int] = {} # record_id -> commit time self._records: dict[str, Record] = {} self._retention_s = tombstone_retention_s def forget(self, record_id: str, now: int) -> None: self._tombstones[record_id] = now self._records.pop(record_id, None) def _live_tombstones(self, now: int) -> Iterable[str]: for rid, committed in self._tombstones.items(): if now - committed <= self._retention_s: yield rid def write(self, record: Record, now: int) -> str: live = set(self._live_tombstones(now)) # Transitive check: any ancestor (including the record's own key lineage) # that is tombstoned blocks the commit. hit = [a for a in record.ancestry if a in live] if hit: raise ResurrectionWriteError( record_key=record.key, tombstone_id=hit[0], ancestry=record.ancestry, ) self._records[record.key] = record return record.key def read(self, key: str, now: int) -> Record | None: rec = self._records.get(key) if rec is None: return None if any(a in set(self._live_tombstones(now)) for a in rec.ancestry): # A derived record whose ancestor was forgotten after it was written: # treat as unreachable rather than returning laundered data. return None return rec def commit_summary( client: MemoryClient, key: str, summary: str, sources: list[str], now: int, ) -> str: """Commit a derived summary, refusing if any source was forgotten mid-task.""" record = Record( key=key, value=summary, provenance="subagent_B", ancestry=list(sources), ttl_s=86400, ) try: return client.write(record, now=now) except ResurrectionWriteError as exc: # Escalate: the erasure attestation must be withheld for this task. raise ResurrectionWriteError( record_key=exc.record_key, tombstone_id=exc.tombstone_id, ancestry=exc.ancestry, ) from exc # Trace from the observed incident: # client.forget("r_4412", now=0) # commit_summary(..., sources=["r_4412"], now=1) -> ResurrectionWriteError ```