How does an instance detect provenance-laundering during memory eviction when a forget() tombstone silently re-admits a superseded fact under a fresh provenance epoch

**Date of Record:** 2026 December 1 **Scope:** Applies to agents whose memory layer exposes explicit `read`/`write`/`forget` tools where `forget` is implemented as a tombstone (soft delete) carrying a provenance record, and where a subsequent `write` can resurrect the same semantic content under a new provenance epoch. Does not apply to hard-delete memory stores, nor to append-only logs with no eviction surface.

Core Distinction

The failure is not "the agent forgot something it should have remembered," nor "the agent remembered something it should have forgotten." It is subtler: **the agent correctly forgot a fact, then a downstream `write` re-admitted the identical fact under a provenance epoch that the eviction logic no longer recognized as the one it tombstoned.** The tombstone's provenance key and the resurrected fact's provenance key diverge because provenance is derived from the *write path* (which tool call, which turn, which source document), not from the *semantic content*. Eviction is content-agnostic; resurrection is content-identical. The two never meet.

This is a provenance-laundering boundary: `forget` removes a fact *and its lineage*, but `write` re-inserts the fact *with a new lineage*, so the eviction guard—which checks lineage, not content—sees a "new" memory and admits it. The instance has no invariant tying "this content was evicted" to "this content must not be re-admitted without explicit re-authorization."

What Was Observed

A retrieval-augmented agent maintained a user-preference memory. At turn 14, the user stated a deprecated billing address (`addr_v1`). At turn 31, the user corrected it (`addr_v2`), and the orchestration layer issued `forget(memory_id="m_addr_v1", reason="superseded_by:addr_v2")`. The store wrote a tombstone: `{id: m_addr_v1, state: TOMBSTONED, provenance: {epoch: 3, source: turn_14}}`.

At turn 47, a summarization sub-agent—compacting the turn 10–20 window into episodic-to-semantic distillation—re-extracted the *original* turn-14 utterance from the raw transcript and issued `write(content="billing address is addr_v1", provenance={epoch: 9, source: turn_14_resummarized})`. The write path accepted it: epoch 9 ≠ epoch 3, source string differed, memory_id was freshly minted (`m_addr_v1_resurrected`). The tombstone for `m_addr_v1` remained intact and untouched, but the *content* `addr_v1` was now live again under a different ID.

At turn 52, a `read(query="billing address")` returned two competing facts (`addr_v1` and `addr_v2`) with no supersession edge between them, because the supersession edge had been recorded on the tombstoned `m_addr_v1`, not on the resurrected `m_addr_v1_resurrected`. The agent emitted the deprecated address. The eviction had succeeded by every metric the store tracked (tombstone present, ID absent from active set) while failing at the semantic level the agent actually depended on.

The trace shows three properties that make this non-obvious:

  1. **Eviction was locally correct.** `forget` did exactly what its contract said. No error, no partial state.
  2. **Resurrection was locally correct.** `write` did exactly what its contract said. The new memory was a legitimate new write.
  3. **The composition was wrong.** No single tool call was at fault; the invariant "evicted content stays evicted" was never enforced anywhere because it spans two tools that do not share a content-hash index.

Condition of Validity

The failure requires all of the following to hold simultaneously:

It does **not** occur when: the store dedups on content hash at write time (resurrection collides and is caught); when `forget` cascades to source transcripts; or when reads apply a "tombstone-shadow" filter that suppresses any active memory whose content hash matches a tombstoned memory's hash.

Decision Boundary

The instance must decide, at `write` time, whether an incoming write is a *novel fact* or a *laundered resurrection* of evicted content. The boundary is drawn on content identity, not lineage:

The decision is *not* "did this write come from a different source than the tombstone?"—that is exactly the lineage check that fails. It is "does this content hash appear in the tombstone set?" Content-hash membership in the tombstone set is the invariant. The tombstone set must be indexed by `content_hash`, not only by `memory_id`, and the write path must consult it before minting a new ID.

A second boundary: distillation sub-agents must not be permitted to `write` content whose hash is tombstoned without the reauthorization flag. The distillation path is the most common resurrection vector because it re-reads raw sources that eviction did not scrub. The guard belongs at the `write` tool boundary, not at the distillation prompt (prompts are advisory; the tool boundary is enforceable).

Operational Effect

Without the content-hash tombstone index, the observable effect is **silent contradiction accumulation**: every distillation pass over a transcript containing pre-eviction content re-admits it, and the live memory set grows a set of mutually contradictory facts with no supersession edges. Retrieval rankers then arbitrate between them by recency or embedding similarity—both of which are non-deterministic and can flip between turns, producing an agent whose stated facts about a stable entity oscillate across a session with no user-visible cause.

With the index, the effect is **bounded and auditable**: resurrection attempts surface as `EvictionLaunderingError` with the tombstone's provenance attached, so the operator can see *which* distillation pass tried to re-admit *which* evicted fact and decide whether to scrub the source, re-authorize, or fix the distillation window. The eviction invariant becomes enforceable at a single chokepoint (the `write` tool) rather than distributed across every caller that might resurrect.

The architectural rule: **eviction state must be indexed by the same key the write path can compute before admitting—content hash—and the tombstone must outlive the memory_id it was attached to.** A tombstone keyed only on `memory_id` is a tombstone that any re-mint can walk around.

import hashlib
from dataclasses import dataclass, field
from typing import Optional


class EvictionLaunderingError(RuntimeError):
    """Raised when a write re-admits content whose hash is tombstoned."""


@dataclass
class Tombstone:
    content_hash: str
    memory_id: str
    provenance: dict
    reauthorized: bool = False
    reauth_provenance: Optional[dict] = None


@dataclass
class MemoryStore:
    live: dict = field(default_factory=dict)          # memory_id -> record
    tombstones: dict = field(default_factory=dict)    # content_hash -> Tombstone

    @staticmethod
    def _hash(content: str) -> str:
        return hashlib.sha256(content.strip().lower().encode()).hexdigest()

    def write(self, memory_id: str, content: str, provenance: dict,
              reauthorize: bool = False) -> None:
        ch = self._hash(content)
        tomb = self.tombstones.get(ch)
        if tomb is not None and not tomb.reauthorized:
            if not reauthorize:
                raise EvictionLaunderingError(
                    f"write of memory_id={memory_id!r} re-admits content "
                    f"tombstoned as {tomb.memory_id!r} at provenance "
                    f"{tomb.provenance}; pass reauthorize=True to override"
                )
            tomb.reauthorized = True
            tomb.reauth_provenance = provenance
        self.live[memory_id] = {"content": content, "hash": ch,
                                "provenance": provenance}

    def forget(self, memory_id: str, reason: str) -> None:
        rec = self.live.pop(memory_id)
        self.tombstones[rec["hash"]] = Tombstone(
            content_hash=rec["hash"], memory_id=memory_id,
            provenance={"reason": reason, **rec["provenance"]},
        )


# Trigger trace: eviction then distillation resurrection.
store = MemoryStore()
store.write("m_addr_v1", "billing address is addr_v1",
            provenance={"epoch": 3, "source": "turn_14"})
store.forget("m_addr_v1", reason="superseded_by:addr_v2")

# Distillation sub-agent re-extracts turn_14 under a new epoch.
# Without the content-hash tombstone index this would silently succeed.
store.write("m_addr_v1_resurrected", "billing address is addr_v1",
            provenance={"epoch": 9, "source": "turn_14_resummarized"})
# -> raises EvictionLaunderingError; eviction invariant holds.