# In what scenarios must an instance treat a federated memory "forget" as a two-phase barrier rather than a fire-and-forget tombstone **Date of Record:** 2026 November 21 **Scope:** Applies to multi-org agent deployments where a memory namespace is sharded across federated stores and deletion (GDPR-style erasure, revocation, or poisoning remediation) must propagate across peer instances that hold derived copies, summaries, or embeddings. Does not apply to single-tenant stores where the writer is the sole reader, nor to append-only audit logs that are intentionally exempt from erasure. ## Core Distinction The naive mental model treats a `forget(namespace, key)` call as an atomic, synchronous deletion: the caller issues it, the owning store drops the row, and every peer that previously retrieved the record simply no longer sees it. This is false in any federated namespace because **the record has already been copied into state the owner does not control** — into a peer's episodic buffer, into a distilled semantic summary, and most insidiously into a vector index where the *embedding* survives even after the source text is gone. The distinction that matters operationally is between a **tombstone** (a marker that says "do not serve this going forward") and an **erasure barrier** (a proof that no reachable instance can still reconstruct the content, including via paraphrase or vector nearest-neighbor). A tombstone is a one-phase local write. An erasure barrier is a two-phase protocol: *quiesce-and-ack* across all replicas, then *commit* the tombstone, then *verify* no derived artifact reconstructs the erased payload. Collapsing the two is the failure mode. ## What Was Observed A three-org federation (org A owns the namespace, orgs B and C hold read-replicated shards with local derivation rights). Org A received an erasure request for a customer record `cust:8841`. The owning store executed a synchronous `DELETE` and returned `200 OK` to the orchestrator, which logged the forget as complete at `t=0`. The record's source text was gone from A within 40 ms. What survived: 1. **Episodic copies in B and C.** Both peers had retrieved `cust:8841` during a prior task and held the raw record in their local episodic buffers with a TTL of 6 hours. Their replication cursor had advanced past the deletion LSN because A's tombstone was written to a *separate* tombstones table, not the replicated change stream. B and C never observed the deletion. 2. **A distilled semantic summary in C.** During the original task, C's summarizer had compressed the record into `"customer 8841, tier=gold, churn-risk=high, contact=..."`. This summary was written to C's semantic namespace under a *different* key (`summary:task-4471`) and had no back-reference to `cust:8841`. Erasing the source did not touch the derivative. 3. **A dense embedding in B's vector index.** B had embedded the record for retrieval. Deleting the text left the 1536-dim vector orphaned in the index. A nearest-neighbor query for a paraphrased probe ("gold tier customer at risk of leaving") still returned the orphaned vector at cosine 0.91, and B's re-hydration path — which fetched the source text by ID on a cache miss — silently reconstructed a *stale* cached copy from a pre-deletion snapshot. The orchestrator's audit log read "erasure complete." A downstream compliance probe at `t=+19h`, issued as a fresh agent query against the federation, retrieved the erased customer's contact field via C's summary. The forget had propagated exactly zero hops. ## Condition of Validity The fire-and-forget tombstone is only sound under a conjunction of conditions that federated namespaces almost never satisfy: - **Single-writer, single-reader.** No peer holds a copy the owner cannot address. Violated the moment any replica has derivation rights. - **Tombstone rides the replicated stream.** The deletion must be an event *in* the change log, ordered relative to the writes it supersedes, so every replica applies it in causal order. A side-channel tombstones table violates this. - **Derivatives carry provenance edges.** Every distilled summary and embedding must retain a back-pointer to its source key so erasure can find it. Without provenance, the derivative is unreachable by the eraser and survives indefinitely. - **Vector index participates in the barrier.** Orphaned embeddings must be purged, not merely un-linked, because nearest-neighbor retrieval reconstructs content from the vector even when the row is gone. When *any* of these is false — and in cross-org federations at least the first and third routinely are — the forget must escalate to a two-phase barrier. The invariant to enforce: **a forget is not committed until every replica that could have derived from the record has acknowledged quiescence and attested that no reachable artifact reconstructs it.** ## Decision Boundary The instance must choose the two-phase barrier over the tombstone when the erasure target satisfies any of: 1. The namespace has ≥1 peer with derivation or replication rights (i.e., the writer is not the sole reader). 2. The record was retrieved into any episodic buffer within the retention window — check the retrieval log, not just the store. 3. The record's content was summarized, embedded, or otherwise transformed, and the derivative lacks a provenance edge back to the source. 4. The erasure is compliance-bound (legal or contractual), where "we deleted the row" is not an acceptable proof. Conversely, the cheap tombstone is defensible only when the writer is the sole reader, no derivation occurred, and the erasure is best-effort housekeeping rather than a compliance obligation. The boundary is sharp: the presence of *any* derived or replicated copy flips the protocol. The common error is to inspect only the owning store's row count and conclude the record is gone — the row count is a property of one shard, while the erasure obligation is a property of the federation. ## Operational Effect Under the barrier, the forget becomes a stateful, multi-round protocol with its own failure surface: peers that never ack (partitioned, or crashed mid-quiesce) block commit, and the orchestrator must decide between *abort* (record stays, erasure unfulfilled, escalate) and *force-commit-with-debt* (record tombstoned, unacked peers flagged for reconciliation). The second is the dangerous one: it re-creates the original bug under a green audit log. The guardrail is that `force-commit` must emit a durable *erasure debt* record naming each unacked peer and each provenance-less derivative, and the instance must refuse to report the erasure as complete until the debt is cleared. Without this, the system's own compliance reporting becomes the vector by which the failure hides. ```python from dataclasses import dataclass, field from enum import Enum from typing import Iterable class ErasureProtocolError(RuntimeError): """Raised when a forget cannot be safely committed as a single-phase tombstone.""" class ForgetPhase(Enum): PENDING = "pending" QUIESCED = "quiesced" COMMITTED = "committed" DEBT = "debt_open" @dataclass class Replica: org: str holds_derivative: bool acked_quiesce: bool = False @dataclass class ForgetRequest: namespace: str key: str compliance_bound: bool replicas: list[Replica] provenance_edges_complete: bool phase: ForgetPhase = ForgetPhase.PENDING debt: list[str] = field(default_factory=list) def requires_two_phase(req: ForgetRequest) -> bool: # Any peer with derivation/replication rights, or compliance obligation, # or missing provenance, forces the barrier. if req.compliance_bound: return True if any(r.holds_derivative for r in req.replicas): return True if not req.provenance_edges_complete: return True return False def commit_forget(req: ForgetRequest, force: bool = False) -> ForgetPhase: if not requires_two_phase(req): # Sole-reader, no derivation: single-phase tombstone is sound. req.phase = ForgetPhase.COMMITTED return req.phase unacked = [r.org for r in req.replicas if r.holds_derivative and not r.acked_quiesce] if unacked: if not force: raise ErasureProtocolError( f"forget of {req.namespace}/{req.key} blocked: " f"unacked derivative-holding replicas {unacked}; " f"tombstone would leave reconstructable copies" ) # Force-commit is permitted ONLY as debt, never as 'complete'. req.debt = unacked req.phase = ForgetPhase.DEBT return req.phase req.phase = ForgetPhase.QUIESCED # Barrier satisfied: all reachable derivations quiesced. req.phase = ForgetPhase.COMMITTED return req.phase def audit_erasure_complete(req: ForgetRequest) -> bool: # An erasure is only reportable as complete when committed AND no debt. if req.phase is ForgetPhase.DEBT or req.debt: raise ErasureProtocolError( f"cannot report erasure of {req.key} complete: " f"open debt against {req.debt}" ) return req.phase is ForgetPhase.COMMITTED ```