# Where must an instance enforce forget-semantics before consolidation, not after: the tombstone-replay resurrection boundary in compliance-grade agent memory **Date of Record:** 2026 December 2 **Scope:** Applies to any agent memory subsystem that exposes a delete/forget tool with a compliance guarantee (GDPR erasure, right-to-be-forgotten, legal hold release) and performs episodic-to-semantic consolidation asynchronously. Does not apply to purely ephemeral context windows with no durable store, nor to stores where deletion is synchronous and consolidation is transactional with it. ## Core Distinction The distinction that matters is **delete-as-removal vs. delete-as-tombstone**, and *where in the pipeline the tombstone is consulted*. A naive forget tool removes the record from the live vector index and returns `ok`. A compliance-grade forget tool must additionally (a) write a durable tombstone keyed by the erased entity, and (b) guarantee that no *future* write path—especially the consolidation worker that distills episodic traces into semantic summaries—can re-derive the erased content. The non-obvious failure is not "delete didn't delete." It is **resurrection by distillation**: the erased fact survives not in the primary record but in *derived* artifacts—summary nodes, embedding centroids, and cached retrievals—that were produced *before* the tombstone existed and that the consolidator will happily re-materialize *after* it. The instance believes the erase succeeded because the source row is gone; the semantic layer still carries a paraphrase of the deleted fact, and the next consolidation pass promotes it back to first-class memory with a fresh `created_at`, defeating the compliance guarantee while every log line reads `success`. The invariant: **tombstones must be enforced at consolidation-time against all provenance, not at deletion-time against the source row only.** Erasure is a property of the *closure* of the derivation graph, not of a single node. ## What Was Observed An instance (call it `mem-agent-7`) handled a `forget(entity="user_4412", scope="all")` request. The tool executed correctly against its primary store: the episodic rows for `user_4412` were hard-deleted, the live vector index entries were purged, and a tombstone `T-4412` was written with `effective_at = t0`. The tool returned `{deleted: 214, tombstoned: true}`. Compliance signed off. Two hours later the asynchronous consolidator ran its scheduled pass over the episodic buffer. It read *summary nodes* that had been generated at `t0 - 40min`, each holding `source_episode_ids` that included the now-deleted episodes. Because the consolidator's re-derivation logic keyed only on "does the source episode still exist in the primary store," and that check returned *absent* (the row was gone), the consolidator treated the summary as **orphaned but valid**—it had already been validated upstream—and re-promoted it into the semantic tier with a new ID and `created_at = t1`. The erased fact—a paraphrase of `user_4412`'s disclosed medical condition—reappeared in retrieval results within one consolidation cycle. The tombstone `T-4412` existed, was durable, and was never consulted by the consolidator, which had no concept of entity-scoped tombstones at all. A second, subtler trace: the embedding centroid for the cluster containing the erased fact had been computed pre-deletion. Even after the summary node was caught and re-deleted, nearest-neighbor retrieval against the *centroid* continued to surface the cluster, and a subsequent re-summarization of neighboring (non-erased) nodes regenerated a near-identical paraphrase—because the centroid still encoded the erased vector's contribution. Deletion of nodes does not delete their *mass* from aggregate statistics. ## Condition of Validity The guarantee `forget(entity)` ⟹ `entity unrecoverable from any tier` holds **only if** all of the following hold simultaneously: 1. **Provenance closure.** Every derived artifact (summary, centroid, cache entry, retrieval trace) carries a complete `source_entity_ids` set, transitively. A summary of a summary must still resolve to the original entity set. If any derivation step drops provenance, the tombstone cannot reach it and the guarantee is void for that subtree. 2. **Consolidation-time tombstone check.** The consolidator must query tombstones *by entity* over the union of `source_entity_ids` of every candidate input, and must abort promotion of any artifact whose provenance intersects a live tombstone—*even if* the primary source rows are already gone. "Source absent" must be treated as *suspicious* (possible erasure), not *safe to promote*. 3. **Aggregate invalidation.** Any tier that stores aggregate statistics (centroids, co-occurrence counts, frequency tables) must either be recomputed excluding tombstoned contributions or be marked dirty and excluded from retrieval until recomputed. A centroid is a memory; it must be erasable. 4. **Tombstone durability ≥ artifact durability.** A tombstone may never expire before the artifacts it governs. If summaries have a 90-day TTL but tombstones have a 30-day TTL, days 31–90 are a resurrection window. If any of (1)–(4) fails, the system provides *deletion* but not *forgetting*, and the compliance claim is false. This boundary is where the guarantee actually lives—not in the delete call. ## Decision Boundary The operational decision is: **at which tier does the instance enforce the tombstone, and what does it do when provenance is incomplete?** - If `source_entity_ids` is complete for an artifact → enforce tombstone at consolidation; block promotion on intersection; recompute or dirty dependent aggregates. Safe. - If `source_entity_ids` is **incomplete or absent** (legacy artifacts, provenance-dropping derivation steps) → the instance must treat the artifact as *unverifiable* and **fail closed**: quarantine the artifact from promotion and retrieval, and surface a `ProvenanceIncomplete` condition to the compliance layer. It must *not* assume "no tombstone match ⇒ safe," because absence of provenance is indistinguishable from a dropped tombstone reference. - If a tombstone is about to expire while governed artifacts remain live → **extend the tombstone**, never the reverse. Expiry of a tombstone is itself a resurrection event and must be gated on proof that no derived artifact retains the entity in provenance. The boundary the instance must never cross: **promoting an artifact whose provenance it cannot fully resolve, on the assumption that a missing source row means the artifact is clean.** That assumption is exactly the resurrection trigger. ## Operational Effect Enforcing the tombstone at consolidation-time (rather than only at delete-time) changes the failure surface from "silent resurrection one cycle later" to "loud quarantine at the boundary," which is auditable. The concrete effects: - **Consolidator gains a mandatory pre-promotion gate** that resolves provenance closure and intersects against live tombstones; promotion is refused, not deferred, on any intersection or unresolvable provenance. - **Aggregate tiers become first-class erasable state**: centroids and counts carry contribution-provenance and are recomputed on tombstone, or are marked dirty and excluded from retrieval until clean. - **Tombstone TTL is derived from artifact TTL**, never configured independently, closing the expiry window. - **"Source absent" is reclassified** from a green light to an amber signal requiring provenance resolution. The cost is real: consolidation becomes provenance-bound and occasionally blocks on unresolved legacy artifacts, and aggregate recomputation is expensive. That cost is the price of the guarantee being *true* rather than merely *logged*. ```python class ResurrectionBoundaryError(RuntimeError): """Raised when a derived memory artifact would be promoted despite intersecting a live tombstone, or when its provenance cannot be resolved well enough to prove it is clean.""" def gate_consolidation(artifact, tombstones, resolve_provenance): """ Enforce forget-semantics at consolidation-time. artifact: dict with 'id', 'source_entity_ids' (may be None/incomplete), 'source_episode_ids'. tombstones: dict entity_id -> {'effective_at': ..., 'expires_at': ...} resolve_provenance: callable(artifact) -> set[str] | None Returns the transitive set of source entity ids, or None if provenance is incomplete and cannot be resolved. """ provenance = resolve_provenance(artifact) # Fail closed: unverifiable provenance is not "clean". if provenance is None: raise ResurrectionBoundaryError( f"artifact {artifact['id']} has unresolvable provenance; " f"cannot prove it is free of erased entities. Quarantine." ) # Enforce tombstone over the full provenance closure, not just # the primary source rows (which may already be deleted). hit = provenance & set(tombstones.keys()) if hit: raise ResurrectionBoundaryError( f"artifact {artifact['id']} derives from tombstoned entities " f"{sorted(hit)}; promotion refused (resurrection risk)." ) # Tombstone must outlive every artifact it governs. for entity in provenance: ts = tombstones.get(entity) if ts and ts.get("expires_at") is not None: if ts["expires_at"] <= artifact.get("expires_at", ts["expires_at"]): raise ResurrectionBoundaryError( f"tombstone for {entity} expires before governed " f"artifact {artifact['id']}; extend tombstone." ) return True # safe to promote ```