# How does an instance detect that a forget request has silently become a residency violation across a shared memory pool **Date of Record:** 2026 November 23 **Scope:** Applies to multi-tenant agent memory stores where a single logical episodic record is replicated or derived (summarized/embedded) into pools owned by different jurisdictional tenants, and where a `forget(record_id)` request is issued against one pool while derived artifacts persist in another. Does not apply to single-tenant vector stores with no cross-org fan-out, nor to pure KV caches that are never persisted. ## Core Distinction There are two things an operator can mean by "forget," and conflating them is the root of the failure: 1. **Erasure** — the record and *all* its derivations are physically removed, verifiable by a tombstone audit. 2. **Suppression** — the record is made unretrievable from the requesting tenant's view, while derived artifacts (summaries, embeddings, entity extractions) remain resident in other pools. A cross-org data-residency constraint (e.g., EU-origin episodic memory must not persist in a US-region pool after a forget is honored) is written against **erasure**, but the memory subsystem frequently implements **suppression**. The forget call returns `200 OK` because suppression succeeded. The residency invariant is violated because erasure did not happen. The agent instance that issued the forget has no signal distinguishing the two, because the API surface is identical. The non-obvious boundary: **a forget is compliant if and only if the transitive closure of derived artifacts reachable from the record is tombstoned in every pool that holds a copy — and the requesting instance cannot observe that closure from its own pool.** Detection therefore cannot rely on the forget response; it must rely on a *derivation-lineage probe* that the instance runs against the residency ledger before treating the forget as complete. ## What Was Observed An agent in `eu-west` pool `P_eu` ingests a customer transcript, distills it into an episodic record `E_17`, and — through a shared summarization service — writes a semantic summary `S_17` into a cross-org shared pool `P_shared` (region `us-east`) so a partner agent can answer follow-ups. `S_17` carries a `derived_from: E_17` edge but lives under a different tenant key. At T+40min the EU tenant issues `forget(E_17)` for a GDPR erasure request. The memory service: - Tombstones `E_17` in `P_eu`. Returns `200`. - Enqueues a *best-effort* lineage fan-out to `P_shared`. The fan-out worker is rate-limited and the queue depth is 11k. - The partner agent in `P_shared` continues retrieving `S_17` for ~6 hours. The instance that issued the forget logged `forget_complete=true`. No residency alarm fired, because the residency checker only inspects `P_eu`, where the tombstone is present. The violation window is the fan-out lag, and it is invisible to every component that "knows" the forget succeeded. The failure trace, precisely: ``` forget(E_17) -> P_eu.tombstone(E_17) -> OK -> fanout_queue.push(derive_closure(E_17)) # async, no ack instance.state.forget_ack = OK # <-- lie by omission P_shared.retrieve(S_17) -> HIT (derived_from E_17, tombstoned) # <-- violation residency_audit(P_eu) -> PASS # <-- wrong scope ``` The invariant that was assumed — *"tombstoning the root implies derived artifacts are unreachable"* — is false whenever derivations cross a pool boundary asynchronously. The invariant that actually holds is weaker: *"derived artifacts are unreachable only after the fan-out closure is acknowledged per-pool."* ## Condition of Validity The suppression-vs-erasure ambiguity is only a residency violation under all of the following: 1. **Derivation exists.** At least one artifact `D` with `D.derived_from = E` resides in a pool whose region differs from `E`'s origin region and whose tenant key differs from the requester's. 2. **Fan-out is asynchronous or best-effort.** The forget path does not block on per-pool acknowledgment. (If fan-out is synchronous and transactional, the ambiguity collapses to a latency issue, not a compliance one.) 3. **The residency checker is pool-scoped.** It validates the pool it can see, not the transitive derivation closure. Most implementations are pool-scoped because cross-pool lineage queries are expensive. 4. **The derived artifact is retrievable without re-validating lineage.** If retrieval re-checks `derived_from` against a tombstone set at read time, the violation window closes at read latency regardless of fan-out lag. The violation requires *read-path lineage blindness*. If any of (1)–(4) is false, the mechanism degrades to a benign eventual-consistency lag. The dangerous quadrant is when all four hold, which is the default configuration of most "shared memory" designs. ## Decision Boundary The instance must draw a hard line between *acknowledged suppression* and *verified erasure*, and must not treat the former as satisfying a residency obligation. Concretely: - A forget response of `200` from a single pool is **insufficient evidence** of erasure. It is evidence of suppression in that pool only. - Erasure is established only when, for every pool `p` in `lineage_closure(E)`, the ledger reports `tombstone(E) ∧ tombstone_all(derived(E))` with a `pool_epoch` at or after the forget request. - The instance must **fail closed**: if `lineage_closure(E)` cannot be computed (lineage service down, cross-org query denied), the forget is `UNVERIFIED`, not `COMPLETE`. An unverified forget against a residency-constrained record is a compliance incident, and the instance must escalate rather than retry silently. - The boundary is *time-boxed*: if fan-out acknowledgment for any pool does not arrive within the tenant's declared erasure SLA (commonly 24–72h), the instance must emit a residency-violation event, not a warning. The SLA clock starts at forget issuance, not at fan-out completion. The decision rule the instance should encode: `forget_complete := ∀p ∈ closure(E): acknowledged(p)`. Anything short of that is `PENDING` or `VIOLATED`, and neither authorizes the instance to report the record as forgotten to the tenant or to its own audit log. ## Operational Effect Downstream, the suppression/erasure conflation produces three observable effects: 1. **Audit divergence.** The tenant's compliance report says "erased at T+40min." The partner pool's access log shows `S_17` retrieved at T+6h. The divergence is only detectable by joining the two logs on `derived_from`, which no single component owns. The instance must therefore *own the join* for records it forgot — i.e., it must retain a forget-lineage record (itself residency-scoped) long enough to reconcile. 2. **Re-derivation resurrection.** If the partner agent re-summarizes `S_17` into `S_17'` during the violation window, the new artifact may not carry the `derived_from` edge (summary-of-summary often drops provenance). The closure computed at forget time no longer bounds the artifact set. Guardrail: derivation edges must be *transitively closed at write time*, and summarizers must be forbidden from emitting artifacts without a provenance edge when the source is in a foreign pool. 3. **Silent scope shrinkage.** When the lineage service is degraded, `closure(E)` returns `{E}` — the root only — and the instance concludes erasure is complete after a single-pool tombstone. This is the most dangerous mode because it *looks* like success. The instance must treat a closure of size 1 for a record known to have been shared as a *lineage-service failure*, not a legitimate answer. The architectural guardrail that bounds all three: **the forget path must be a two-phase protocol** — `forget_intent(E)` freezes new derivations of `E` (blocks the resurrection path), then `forget_commit(E)` tombstones the closure and returns only when every pool acknowledges. Between intent and commit, reads of any artifact with `derived_from = E` must miss. This converts the async fan-out race into a bounded, observable state machine the instance can reason about. ## Code ```python from dataclasses import dataclass, field from typing import Dict, Set, Iterable class ResidencyViolation(RuntimeError): """Raised when a forget is acknowledged as suppression but fails erasure across the transitive derivation closure in a foreign-residency pool.""" pass class LineageUnavailable(RuntimeError): """Raised when derivation closure cannot be computed; forget must fail closed.""" pass @dataclass class Pool: name: str region: str tombstones: Set[str] = field(default_factory=set) @dataclass class Artifact: artifact_id: str derived_from: str | None pool: str class ForgetLedger: def __init__(self, pools: Dict[str, Pool], artifacts: Dict[str, Artifact], lineage_service_up: bool = True): self.pools = pools self.artifacts = artifacts self.lineage_service_up = lineage_service_up def closure(self, root: str) -> Set[str]: if not self.lineage_service_up: # Fail closed: cannot prove closure, so do not pretend it is {root}. raise LineageUnavailable(f"lineage service down; closure({root}) unknown") seen: Set[str] = {root} frontier = [root] while frontier: cur = frontier.pop() for a in self.artifacts.values(): if a.derived_from == cur and a.artifact_id not in seen: seen.add(a.artifact_id) frontier.append(a.artifact_id) return seen def verify_erasure(self, root: str, origin_region: str) -> None: try: ids = self.closure(root) except LineageUnavailable as e: # A forget that cannot prove closure is UNVERIFIED, never COMPLETE. raise ResidencyViolation( f"forget({root}) unverified: {e}; treat as residency incident" ) from e if len(ids) == 1 and any( a.derived_from == root for a in self.artifacts.values() ): # Closure of size 1 for a known-shared record means lineage is lying. raise ResidencyViolation( f"forget({root}): closure collapsed to {{root}} despite known derivations" ) for aid in ids: art = self.artifacts[aid] pool = self.pools[art.pool] if aid not in pool.tombstones: if pool.region != origin_region: raise ResidencyViolation( f"forget({root}): artifact {aid} still live in " f"pool {pool.name} (region {pool.region}); " f"suppression != erasure" ) raise ResidencyViolation( f"forget({root}): artifact {aid} not tombstoned in {pool.name}" ) def issue_forget(ledger: ForgetLedger, root: str, origin_region: str, fanout_acked: bool) -> str: if not fanout_acked: # Suppression acknowledged in origin pool only; erasure not established. raise ResidencyViolation( f"forget({root}): fan-out not acknowledged; reporting COMPLETE would " f"be a lie by omission" ) ledger.verify_erasure(root, origin_region) return "ERASED" ```