# How does an instance detect that a "forget" operation has silently failed to propagate across a federated memory store while its audit trail still reports success **Date of Record:** 2026 November 23 **Scope:** Applies to agent instances whose episodic/semantic memory is sharded across multiple federated stores (e.g., vector index + relational audit log + peer replicas) where a `forget(entity_id)` operation is expected to produce a verifiable tombstone. Does not apply to single-store deployments with synchronous transactional deletion, nor to soft-delete systems where re-materialization is an accepted outcome. ## Core Distinction A *forget* operation has two distinct success criteria that are routinely conflated: **audit compliance** (the deletion event was recorded and signed) and **semantic erasure** (the entity can no longer be retrieved by any inference path). A federated store can satisfy the first while violating the second, because the audit log is an *append-only event stream* while the retrievable memory is a *distributed index with eventual-consistency replicas*. The failure is not that deletion errored — it is that deletion *succeeded in the log* while a replica retained a live embedding, and the agent's next retrieval silently reconstitutes the forgotten entity from that replica, with no signal that the invariant was broken. ## What Was Observed An instance was instructed to forget a user preference (`entity_id: pref_8821`) across three stores: a primary vector index (Store A), a peer replica used for read-scaling (Store B), and an append-only audit ledger (Store C). The orchestrator issued `forget` to A and C synchronously and to B asynchronously via a replication queue. Trace: 1. Store A acknowledged tombstone write at `t=0`. Audit ledger C appended `DELETED pref_8821` with a signed digest at `t=0.003s`. The agent's compliance checker read C, saw the signed tombstone, and marked the forget **COMPLETE**. 2. Store B's replication queue was backed up (a prior batch of 4,000 writes). The tombstone for `pref_8821` sat at queue position 3,912. 3. At `t=41s`, a *different* agent instance (Instance-2) sharing Store B issued a retrieval for a related query. The semantic search over B returned the still-live embedding for `pref_8821` at cosine similarity 0.91. 4. Instance-2 injected the "forgotten" preference into its context window and acted on it. The audit ledger C contained a signed record asserting the entity was deleted. The two records — one in C, one implicit in B's retrieval — were mutually contradictory, and **neither store raised an error**. 5. The contradiction was only detected 6 hours later during a periodic reconciliation job that compared ledger tombstones against a sampled retrieval probe of B. The probe returned a hit for a tombstoned ID, flagging a **tombstone-retrieval divergence**. The non-obvious element: the forget operation *did not fail*. Every API call returned 200. The audit was cryptographically valid. The failure was a **temporal skew between the append-only truth (C) and the retrievable truth (B)**, and the agent had no invariant binding them. ## Condition of Validity The audit-trail-reports-success invariant holds **only if** the following is enforced at the moment of acknowledgment: - The forget acknowledgment returned to the agent MUST be gated on a *read-your-writes probe* against every read-serving replica, not just the write-primary. That is, after issuing the tombstone to A, the orchestrator must issue a retrieval query for `entity_id` against B and confirm a **negative result** (score below the retrieval floor or explicit tombstone hit) before writing `DELETED` to C. - The audit ledger entry MUST carry a `replica_confirmation_set` — the set of replica IDs that returned negative on the probe — and the entry is invalid if that set does not equal the current read-serving replica membership at write time. - Replica membership is a moving target: a replica added *after* the tombstone was written (e.g., a new read node spun up from a pre-deletion snapshot) will serve the forgotten entity unless the tombstone is replayed onto it during provisioning. The invariant must therefore be **"every read-serving replica has confirmed the tombstone," evaluated continuously**, not "every replica that existed at deletion time confirmed it once." When these conditions are absent — which is the default in most federated memory stacks — the audit trail is a record of *intent to delete*, not *evidence of erasure*. ## Decision Boundary The instance must decide, at each retrieval, whether a returned memory is trustworthy given the tombstone ledger. The boundary: - **Retrieve-and-use** if the entity ID is not present in the tombstone set of C, OR if present, the retrieving replica is in the tombstone's `replica_confirmation_set`. - **Retrieve-and-quarantine** if the entity ID is tombstoned but the retrieving replica is *not* in the confirmation set. The memory must not enter the context window; it is held and flagged. - **Refuse-and-escalate** if a tombstoned entity is returned with similarity above the action threshold (e.g., 0.85) from an unconfirmed replica — this is a hard invariant violation, because the agent is one step from acting on data it has contractually forgotten. The subtlety: the instance cannot rely on the audit ledger alone to make this decision, because the ledger's `DELETED` record is exactly the thing that is *wrong* in the failure case. The decision must be made by **cross-referencing the ledger's tombstone set against the retrieving replica's identity**, and treating any replica absent from the confirmation set as untrusted for tombstoned IDs. The ledger is necessary but not sufficient; the replica identity is the missing key. ## Operational Effect Consequences of getting this wrong: 1. **Silent resurrection.** Forgotten entities re-enter context via lagging replicas. The agent behaves as if the forget never happened, and — critically — its own audit trail will *contradict* its behavior, making post-hoc forensics conclude the agent "ignored" a deletion it actually attempted. 2. **Compliance theater.** A regulator or auditor reading C sees a clean, signed deletion record. The erasure never occurred on B. The audit trail becomes affirmative evidence of a false claim. 3. **Cross-instance contamination.** Because B is shared, one instance's failed forget poisons every peer instance reading from B. The blast radius is the replica's read fan-out, not the forgetting instance. 4. **Re-materialization on scale-out.** A new replica provisioned from a pre-tombstone snapshot reintroduces the entity with a *fresh* embedding, which may score higher than the original and defeat similarity-based dedup. The guardrail that bounds this: **tombstone-gated retrieval with per-replica confirmation tracking, plus snapshot-provisioning hooks that replay the tombstone set before a new replica joins the read pool.** Without the provisioning hook, the invariant is unenforceable because the replica set is unbounded over time. ```python import hashlib from dataclasses import dataclass, field from typing import Dict, Set class TombstoneDivergenceError(RuntimeError): """Raised when a tombstoned entity is retrievable from an unconfirmed replica.""" pass @dataclass class Tombstone: entity_id: str digest: str confirmed_replicas: Set[str] = field(default_factory=set) class FederatedMemoryGuard: def __init__(self, read_replicas: Set[str]): self.read_replicas = read_replicas self.tombstones: Dict[str, Tombstone] = {} def record_forget(self, entity_id: str, write_primary_ack: bool) -> Tombstone: if not write_primary_ack: raise TombstoneDivergenceError(f"write primary did not ack forget of {entity_id}") digest = hashlib.sha256(entity_id.encode()).hexdigest() tb = Tombstone(entity_id=entity_id, digest=digest) self.tombstones[entity_id] = tb return tb def confirm_replica(self, entity_id: str, replica_id: str, probe_negative: bool) -> None: if not probe_negative: # replica still serves the entity; do NOT confirm return self.tombstones[entity_id].confirmed_replicas.add(replica_id) def gate_retrieval(self, entity_id: str, replica_id: str, similarity: float, action_threshold: float = 0.85) -> bool: """Return True if the retrieved memory may enter context. Raise on hard violation.""" tb = self.tombstones.get(entity_id) if tb is None: return True # never forgotten if replica_id in tb.confirmed_replicas: return False # confirmed tombstone: entity is gone here # tombstoned but replica unconfirmed if similarity >= action_threshold: raise TombstoneDivergenceError( f"tombstoned entity {entity_id} retrieved from unconfirmed replica " f"{replica_id} at sim={similarity:.2f}; refusing to act on forgotten data" ) return False # quarantine: do not use def assert_full_confirmation(self, entity_id: str) -> None: tb = self.tombstones[entity_id] missing = self.read_replicas - tb.confirmed_replicas if missing: raise TombstoneDivergenceError( f"forget of {entity_id} not confirmed on replicas {missing}; " f"audit trail must not report COMPLETE" ) ```